OpenGL/GLUT glutTimerFunc slows down
Hello fellow stackoverflow users!

I don't have a real problem that needs a fix, I just want some information. I have an openGL/GLUT application that uses ball collision detection. Everything works splendid and everything runs good. BUT

When the update function (that advances all the balls, check for collisions with other balls or walls and so on) is placed in the glutTimerFunc to update I get a nice 13.5 FPS, and everything runs slow. The update timer of the function itself is high enough to not generate any overhead or whatsoever.

So now I place the advance function for my collision detection in my main draw function (called by glutDisplayFunc & glutIdleFunc) and suprise suprise I have steady 60.5 FPS, no lag and smooth animations.

So how is this possible? Does it have to do with the fact that glutTimerFunc gets called to many times and slow everything down or is there some GLUT reason for it? Like I said nothing is changed just one function is place in another function call.

Thanks alot!
OpenGL/GLUT glutTimerFunc slows down
===

Hello fellow stackoverflow users!

I don't have a real problem that needs a fix, I just want some information. I have an openGL/GLUT application that uses ball collision detection. Everything works splendid and everything runs good. BUT

When the update function (that advances all the balls, check for collisions with other balls or walls and so on) is placed in the glutTimerFunc to update I get a nice 13.5 FPS, and everything runs slow. The update timer of the function itself is high enough to not generate any overhead or whatsoever.

So now I place the advance function for my collision detection in my main draw function (called by glutDisplayFunc & glutIdleFunc) and suprise suprise I have steady 60.5 FPS, no lag and smooth animations.

So how is this possible? Does it have to do with the fact that glutTimerFunc gets called to many times and slow everything down or is there some GLUT reason for it? Like I said nothing is changed just one function is place in another function call.

Thanks alot!