View Full Version : Could I cache my Framebuffer ?

02-09-2004, 07:05 AM
I'm beginner in OpenGL.
I make blending of several layers by glDrawPixel().
It takes time. After that I should draw temporary figure(like selection semitransparent quad).
I should redraw my temporary figure very often with mouse move event.

How could I improve my performance, and don't glDrawPixel() for every event?

02-09-2004, 07:11 AM
I'm not sure I can offer a proper solution, but have you taken a look at Display Lists and Vertex Arrays? Maybe they can give you a boost, but I'm not sure you can use them with glDrawPixels.

02-09-2004, 08:25 AM
You should try using textured quads instead of glDrawPixels

02-09-2004, 11:53 PM
You could save your composited image once and redraw that instead of compositing all layers over and over again.

The slow (always working) way is glReadPixels once, glDrawPixels per selection update.
A fast way is glCopyTex(Sub)Image2D once, draw textured quads per selection update.
Another way is wglSaveBufferRegion once, wglRestoreBufferRegion per selection update. Needs this extension http://oss.sgi.com/projects/ogl-sample/registry/ARB/wgl_buffer_region.txt