Hello,
One of the reasons I got into freeglut was its MainLoopEvent function, which
allows me not to relinguish control of flow to glut. But I am observing a
problem with it that hopefully someone can fix for me?
My molecular dynamic has the following structure:
DO update=1, n_updates
DO time=0,T,dT
CALL TakeATimeStep
CALL glutEventMainLoop
END DO
IF(glut_window_closed) EXIT ! The user can stop the processing
CALL glutPostRedisplay ! Time to update the rendering
END DO
The point is that I do not want to update the plot too often, but events
should be processed often (in case the user does something). If the user
closes the window, the glutCloseFunc callback sets a flag which stops the
processing.
But this does not quite work because it seems glutMainLoopEvent does not call
the window Close callback? Therefore I cannot tell that the window was closed
and the call to glutPostRedisplay aborts with an error. glutMainLoop does
call the callback just fine, but not the event function. I do not quite know
the inards of the freeglut event queue, so can someone fix this for me and
send me the corrected freeglut_main.c?
Thanks,
Aleksandar
--
NOTE change of primary e-mail to adonev@...
__________________________________
Aleksandar Donev
Complex Materials Theory Group (http://cherrypit.princeton.edu/)
Princeton Materials Institute &
Program in Applied and Computational Mathematics
@ Princeton University
Address:
419 Bowen Hall, 70 Prospect Avenue
Princeton University
Princeton, NJ 08540-5211
E-mail: adonev@...
WWW: http://atom.princeton.edu/donev
Phone: (609) 258-2775
Fax: (609) 258-1177
__________________________________
|