Reputation: 781
Im using GLUT and i need to refresh a draw inside the idle function, my code is something like that:
void idle(){
for(int i ;i<cant;i++){
/* do some stuff*/
glutPostRedisplay();
}
}
inside the idle function proccess de data what i want to redraw in every itaration.
Someone can help me?
Upvotes: 0
Views: 640
Reputation: 734
Do one (or few) things in idle, then postRedisplay. Let the timer (calling idle) do the loop !
you should ensure than the computation load of idle + redisplay is largely less than the timer rate you required (or the FPS you expect).
Upvotes: 3