Extracting color buffer from an OpenGL app.

Hi ppl,

I wondering if it is possible to get a color buffer from an OpenGL app. i.e. Take a screenshot out of say, Quake 3 while it is running.

I was thinking it should be possible, because the color buffer is there on your computer, I just don’t know how to access it.

press the printscreenkey.

Ok, I mean to have a program do this automatically.

You could try using FindWindow to locate the Quake3 window, then use GetWindowDC to get the applications device context using the HWND returned by FindWindow, then use wglGetCurrentContext to get the rendering context for that window.

Finally, you should be able to use glReadPixels to capture the contents of the OpenGL context.

No idea if this will actually work, haven’t tried it myself

Quake3?
Why don’t you just press F11?

For your own stuff, use glReadPixels.

thanks jra101

well, zeckensack, I’m using Quake 3 as an example. I want to be able to do this for any OpenGL App.