View Full Version : Saving OpenGL screen as bitmap?

08-26-2009, 11:31 AM
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!

08-31-2009, 02: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) .

08-31-2009, 03: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/)