#49 remove fgDeinitialize from glutMainLoop

open
nobody
Easy (28)
5
2006-08-24
2006-08-24
Anonymous
No

Hi there!

I love freeglut's feature of offering glutMainLoopEvent
and a proper exit from the glutMainLoop. However, in
many cases I'd like the glutMainLoop NOT to
deinitialize the glut engine - just as
glutMainLoopEvent does not deinitialize the glut
engine. For my porposes, proper pseudo code is:

(1) initialize glut
(2) set the GLUT_ACTION_CONTINUE_OPTION
(3) create a window
(4) call glutMainLoop, which exits properly when
hitting ENTER
(5) do other computations in the main file
(6) call again glutMainLoop - activating interaction
with the same previously created window - exiting on ENTER
(7) finally call glutDeinitialize in the main() function
(8) exit

This is much more consistent: When you initialize glut
in the main() function, then one should also control
the deinitialization in the main() function.

Only change required:

remove the fgDeinitialize from the glutMainLoop

THANKS!

Marc Toussaint

Discussion