screen shot in opengl

Started by
4 comments, last by dragonsimoto 22 years, 2 months ago
I was wondering how u get a Screenshot of just the window using vc++ 6? any sources for examples or emails would be great!
Advertisement
That would probably be pretty hard. I would suggest going into fullscreen mode and then just writing the whole screen color buffer into a .bmp or whatever file format you want to use. Hope this helps.
glReadPixels(...) to dump the framebuffer to memory as an array of bytes

Write "P3 < image width > < image height > 255< newline >"
(e.g. "P3 800 600 255")

Then write out the RGB triplets for each pixel in ascii format
(max, 70 character per line)

Save that as a .PPM file

Alternatively, put P6 in the header line and spit your triplets in binary.


Edited by - Fruny on February 17, 2002 12:21:10 AM
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Did you try switching to the window and pressing Print Screen? and then going to a paint program and going edit->paste?
d0h!

Maybe he wants to insert a function so the user can easily make screenshots, or for the programme itself to make screenshots every x minutes?


''Qui habet aures audiendi audiat'' - Me

A link to the website of my 3D engine will follow as soon as I have something concrete to show... Which will be soon.
the print screen thing doesn''t always work - it depends on the GL implementation.

-

Geocyte Has Committed Suicide.
Geocyte Has Committed Suicide.

This topic is closed to new replies.

Advertisement