PDA

View Full Version : Saving OpenGL screen as bitmap?



PowersWithin
08-26-2009, 12:31 PM
What would be a way to save the current OpenGL screen into a bitmap? I know it'll involve glReadPixels() but how do you go about using it and using the data it collected to get a bitmap file? Thanks!

todayman
08-31-2009, 03:25 PM
Check out the glReadPixels() man page (http://www.opengl.org/sdk/docs/man/xhtml/glReadPixels.xml) and a description of the BMP file format (http://en.wikipedia.org/wiki/BMP_file_format) .

MaxH
08-31-2009, 04:54 PM
Also, you might want to check out the Devil Image Loading and Writing library at -

Devil Image Handling Library (http://openil.sourceforge.net/)