Redraw on Mouse Move

Hi Friends,

I’m trying to develop a 3D drawing application. Now i can a draw a line using the mouse. While drawing, double click to start the line and another double click to finish the line. So after first double click , i draw the entire scene again and again on mouse move util we click another double click to finish the line. If i have only few no. of line while i draw a new line means its no problem to update the entire scene for every mouse move. But if i have more than 10000 lines means is slow down the drawing speed ?

What my problem is, if anther commands available in opengl to avoid redraw of exist lines while draw a new line ?


10000 lines should not be slow on modern hardware.
But if you want to really scale, a good way is to render existing scene to a texture on first click, then during interactive mouse move, only draw textured quad with previous scene, plus the few new lines.


Can u please tell me how to render the existing scene to a texture on click ?

Thank u.

The easiest is to do glCopyTexSubImage2d(), but it only works for visible parts of the rendered window. Try this first.
The more robust way is to render to an offscreen FBO :
The are also good tutorials on the web.

You can also use the scissor tests

scissor tests : how could that possibly help for the mentioned problem ?