PDA

View Full Version : Problem Calling Repaint without using glutIdleFunc()



abhinav_ranjan
06-27-2001, 11:05 PM
I want to call repaint function only when there is change in the screen ,but right now i am using glutIdleFunc() which constantly calls the repaint function.This is hampering the performance of my application.Is there any better way of doing so?

regards

Abhinav

john
06-28-2001, 02:51 PM
What do you mean by 'change'?

glut will call your render function when
- your application gets expose events
- when it is reshaped (which triggers its own expose events, after all)

so you can safely NEVER have a glutPostRedisplay() and have your window repainted when needed.

However, if you mean yoru *scene* changes, then you'll need to keep track of that yourself and only call glutPostRedisplay in your idle func if you've moved geometry around.

cheers,
John