prevent flickering

How can i prevent flickering of my object while rotation, by using double buffers

I wondering when you would ask about that!!

The flickering caused by the clearing and redrawing of a scene in the same buffer. Most games 2D/3D use the double buffer technech.

How double buffering works.
When drawning with double buffers, opengl draws to a buffer not being displayed.
And only after you have drawn your scene do you change buffers. This way the user only see completed screens.

Add this to your display routine glutSwapBuffers(), it should be the last call.

add this to you main routine:

glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);

Originally posted by xypher:
How can i prevent flickering of my object while rotation, by using double buffers

[This message has been edited by nexusone (edited 09-23-2002).]

you are very helpful,
Thank you