When you need to make a zoom window command on a OpenGL surface, you need to draw in 2D screen coordinates a rectangle while dragging.
Now we are drawing this rectangle re-drawing the whole scene and of course when the scene become complex the fps rate drops too much for a pleasant user experience.
Is it possible to:
- keep a copy of the screen surface
- draw current rectangle
- recover the old screen
- draw the new rectangle
using the front and back buffer?