tags:

views:

29

answers:

1

I know it sounds like a redundant and obvious/stupid question, but the documentation doesn't explicitly state it.

If I initialize a variable inside main would it get to be reinitialized each time a glut event occurs (like the window gets resized, the mouse moved, a key gets pressed, etc.)?

+1  A: 

The link you provided says what it does.

This routine should be called at most once in a GLUT program. Once called, this routine will never return.

If you call this in main() any statements following the call will not be executed.

Blastfurnace
No, that's not the question. What if I initialize a variable *before* writing glutMainLoop(); would it get re-run and re-initialized (like in a *loop*)??
omgzor
No it would not. The function glutMainLoop() contains the GLUT event loop. The call never returns to the calling point so the only way to change those variables again is if one of your callback functions can see them and change them.
Blastfurnace
Thanks. That's it.
omgzor