lua-users home
lua-l archive

saving image from tkgllua buffer

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm trying to save images from the openGL canvas
under tklua and gllua. 
I'm using some C code a friend gave me
to do it, but I'm always getting all blacks.
I tryed a combination of different things,
in the hope that it was just trying to grab
the image before openGL was done drawing.
I used glFlush(), glFinish, even
(canvas)::makecurrent().
basically my last attempt was:
 setframe(i)
 tkupdate("idletasks")
 glFlush()
 glFinish()
 canvas:makecurrent()
 WriteImage (fname, wcvs, hcvs)
where setframe(i) draws the i^th frame
of my animation, issues a glFlush() and
a canvas::swapbuffers() 
(where canvas is my openGL canvas handle, fname 
is the filename and wcvs/hcvs are the dimensions
of the canvas)
I'm sure I'm missing something obvious...
Thanks
Siome
-- 
----------------------------
Siome Klein Goldenstein
siome@cis.upenn.edu
http://www.cis.upenn.edu/~siome

AltStyle によって変換されたページ (->オリジナル) /