View Full Version : for OneSadCookie
ObjectCreator
2002.07.25, 08:38 AM
Thanks again for the Truform help. I've read a post where you talk about glReadPixels. How I can do for save a NSOpenGLView in a QuickTime picture? Thanx
OneSadCookie
2002.07.25, 06:13 PM
I'm afraid I don't know how to write out pictures using QuickTime. It's not something I've ever wanted to do. I've got some hack code for writing .bmp screenshots from OpenGL, but it's really ugly -- I wouldn't wish it upon anybody.
Ian Kerr
2002.08.16, 12:36 AM
This bit of code is from my engine (CEGL Engine in the dev diaries). It just reads pixels from the buffer and saves them as a TGA file which QuickTime can load. Picture Viewer doesn't seem to want to load these files. This code was in OpenGL Game Programming, but I had to change it so that all the data was converted to little endian first...
http://www.mnsi.net/~rkerr/source/openglscreenshot.cpp
All the CEGL_ variables can be changed to their respective types. CEGL_UChar for example would be unisgned char. The endian conversions can be done with a file called Endian.h that is included with CodeWarrior. Use that instead of the CEGL_Serialize methods. CEGL_Serialize simply does the appropriate endian conversion and then saves the variable to file.
If you render a screen capture out each frame you can "Open Image Sequence" in QT and create a movie out of them. Also keep in mind that the size of the buffer is fixed so you'll have to adjust it to your dimensions. Right now it's set at 1024*768*3.
Carbon_GLSnapshot @ Apple Developer Site (http://developer.apple.com/samplecode/Sample_Code/Graphics_3D/Carbon_GLSnapshot.htm)
Sounds like it does exactly what you want.
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.