Advertisement

Saving the current contents of the framebuffer to a file

Started by May 23, 2002 06:42 PM
1 comment, last by Hyper165 22 years, 9 months ago
How do I (programmatically) save what''s currently on the screen to a file? What I want to happen is have the user press the Print-Screen key and have a new file (bmp, png, jpg, whatever) created somewhere on the disk that holds the contents of the screen. If no one wants (or can) post some code showing how to do this, does anyone know where I might be able to find an extension that does this? Thanks
nehe had something like this in their code.
you''ll just have to search there, i''m sure its easy to find.

[Hugo Ferreira][Positronic Dreams][]
"Somewhere, something incredible is waiting to be known."
- Carl Edward Sagan (1934 - 1996)

Advertisement
Use glReadPixels() to get the pixel data from the frame buffer. Having gotten that, it should be easy to output the raster to the file format of your choice.

This topic is closed to new replies.

Advertisement