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?
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