PDA

View Full Version : glutGameMode Flicker Problem



AngryChipmunk
07-10-2003, 10:09 AM
I am running in gameMode and using the glut timer func with 1 sec updates.

Inside the glutTimer callback, I call glutPostRedisplay.

Unfortunately, the objects aren't being refreshed enough; they disappear.

I added glutIdleFunc, but that makes the objects constantly flicker.

If I don't run in gameMode everything works.

Any idea what's going on?

Thanks for the help.

nexusone
07-10-2003, 12:27 PM
Are you still calling the glutPostRedisplay in the glutTimer function?

The flicker could be you are moving data faster then your video card can handle. Make sure you only update it in one routine and not both.


Also it could be how you are drawing your objects, they should not disapear because your update is too slow.



Originally posted by AngryChipmunk:
I am running in gameMode and using the glut timer func with 1 sec updates.

Inside the glutTimer callback, I call glutPostRedisplay.

Unfortunately, the objects aren't being refreshed enough; they disappear.

I added glutIdleFunc, but that makes the objects constantly flicker.

If I don't run in gameMode everything works.

Any idea what's going on?

Thanks for the help.

Jared@ETC
07-10-2003, 12:38 PM
If you are using double buffering, do you swap buffers only when in this timer function?

dorbie
07-11-2003, 08:30 AM
It sounds to me like you are NOT double buffering and you need to. Look into double buffering and request double buffering from GLUT. You need to redraw EVERYTHING every frame to make this work, but that's how almost all 3D animated applications & games work.