Need Code to Capture an Opengl Window and Save it to a BMP

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

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, there are examples using both of the methods above. Good luck!

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