Capturing image as bitmap

I’m writing a 3D graphics software and I’d like to make calculations on a particular scene. OpenGL doesn’t support this, so I was thinking about capturing the scene to a bitmap file and then writing another small program to do the calculations. Does anyone know how to capture an OpenGL scene to a bitmap file?

If only I had a dime for every time I posted this URL… why oh why don’t people use the “Search”?

Okay, I went to that link. I took the screenshot.h and screenshot.c files and made a project with them for visual C++. I also linked the necessary openGL libraries in the settings:
OpenGL32.lib GLu32.lib and GLaux.lib

So why do I get 81 errors when I compile. Not only that, but most of the errors are in the gl.h header file. What am I forgetting to do?? Or what am I doing completely wrong??

You didn’t post any errors, but since you said you are getting errors in gl.h, I’m guessing those errors are along the lines of APIENTRY being undefined?

Do this.
#include <windows.h> //defines APIENTRY and other stuff used in gl.h

Note the order… windows.h, then gl.h

In real life I am the Amazing Kreskin the Mentalist. Without seeing the errors (which you should always post, by the way, if you want people to help you) I’ll bet you also get problems with attribute((packed)).

Now, of course, the first thing you do is go to Google and search for attribute((packed)). Eventually you will hit upon
that explains that attribute((packed)) is a GCC extensions which says that the structures should be packed as tightly as possible.

And then, of course, you turn to the Visual Studio documentation to see how to accomplish the same thing. Hint: #pragma packed.

[This message has been edited by rts (edited 04-06-2002).]