View Full Version : screeshots

03-14-2000, 01:02 AM
i wanna make screenshots of my program
whats the best way and how does it work with non-opengl programs?

03-14-2000, 02:27 AM

There is a function called glReadPixels you can use to read the pixels from a buffer. To the function you pass the coordinates of the box you want to get (in your case, the entire screen), in what format you want to obtain the data (as float, int, byte), how you want the data to be packed (RGB, RGBA...), what buffer (colorbuffer, depthbuffer...), and a pointer an array where you want the data to be placed.
Then you have to write the data to a file in a nice format.
As far as I know, this is the only way to make screenshots in OpenGL.

However, this method is not working in non-gl programs, since glReadPixels is a OpenGL function.


03-14-2000, 05:10 AM
If you need just a few screenshots you can use in Windows the 'print'-key on your keyboard... http://www.opengl.org/discussion_boards/ubb/wink.gif