PDA

View Full Version : Need Code to Capture an Opengl Window and Save it to a BMP



ca2hill
01-16-2002, 07:42 PM
Hi,

I need code to capture an Opengl window and save it to a BMP. I'm using GLUT.

I don't think this is that difficult task, but I can't seem to figure out how to do it or where to find info. on it.

Any help is greatly appreciated.

Thanks in advance,
Chris
Chris

Xiaofeng
01-16-2002, 08:53 PM
Originally posted by ca2hill:

I need code to capture an Opengl window and save it to a BMP. I'm using GLUT.


Hi,
I think you can obtain piles of codes from the web, generally speeking, there are two ways:
1. capture the screen
2. draw to a bitmap dc
p.s. In www.codeguru.com, (http://www.codeguru.com,) there are examples using both of the methods above. Good luck!

spideygl
01-16-2002, 09:07 PM
Here's some code for screenshots in TGA format. You could easily convert it to BMP code. Or you could use photoshop or something to convert to BMP.
http://www.essi.fr/~buffa/cours/synthese_image/DOCS/Tutoriaux/Nate/index-4.htm

spideygl