Saving front buffer for later vram use?*$!

Hi guys,

In my OpenGL/Windows program, I want to save the content of the front buffer for later blit to the backbuffer. As you may have guessed I want to do that frequently (each frame in fact) so performance matter. It should be speed as it involves only VRAM TO VRAM operations.

Something pretty simple but I just can’t find a way to do that.
I’ve tried layers (not supported), buffer regions ARB extension (not supported) and of course glDrawPixels mixed with some GDI (incredibly slow!). I can’t use a texture to store the content of the buffer as it may exceed 1024x1024 and is not necessary power of 2.

Please help me!

Firstly, and before I can answer, why do you want to save the front buffer and later blit it to the back buffer? Maybe we can provide you with alternative to acheive what you want.

Secondly, why do you need to mix glDrawpixels with GDI. You can always avoid GDI with OpenGL.


I must say what I want to do is really special. My app is not the only to write in its window. When the other app has written in it, I want to keep the content to use it as background for next rendering. Unusal, I know.

I use GDI to save the content of the front buffer because glReadPixels is so slow (as glDrawPixels).

Now I’m thinking of using multiple textures & glCopyPixels. I wonder if 1) it’s going to be speed enough 2) it’s visually going to be the same thing…

Any ideas???

I don’t know if I understood you or not, but maybe you can try blending, or accumulation buffer of maybe try not to clear the color buffer (only clear the depth buffer) and do another rendering pass. I’m not sure though.