PDA

View Full Version : flickering, back buffers



Andrew Davey
03-31-2004, 05:26 AM
I have some flickering when drawing, and have just searched the fourm for any help, came across something that may help.

The guy basically said i should also draw my image(s) onto the back buffer as well and then swap the buffers.

My question is how do i draw onto the back buffer, i can swap buffers fine and have just leanr the timerFunc().

Cheers (sorry for constant posts)

nexusone
03-31-2004, 05:34 AM
Look at my examples on my website, I use double buffering.

Example of how to do it under glut:
www.angelfire.com/linux/nexusone/ (http://www.angelfire.com/linux/nexusone/)

Andrew Davey
03-31-2004, 06:04 AM
gotcha, been looking at your code and i think i finally understand why you have your timerFunc as a different one and not in side your display, as i have it at the minute

Does this effect the animation at all? as that is why i think you have done it.

nexusone
03-31-2004, 07:06 AM
I also like to refer to my timerFunc as a control function. In it I can control animation speed also other events.

To control animation, just adjust the timer event cycle, larger time slower animation.

Most people new to how computer function think in 1 dimention, where as in a computer program you must not think in terms single events.

But you must think a little out of the box.

In other programs my timerfunc will also control player movement, AI movement(enemy ship, computer player, etc). Since even if the player is not moving, the other animations and AI will.