PDA

View Full Version : prevent flickering



09-23-2002, 09:09 AM
How can i prevent flickering of my object while rotation, by using double buffers

nexusone
09-23-2002, 09:35 AM
I wondering when you would ask about that!! http://www.opengl.org/discussion_boards/ubb/smile.gif

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).]

09-23-2002, 10:05 AM
you are very helpful,
Thank you