Moved the idle callback out of glutMainLoopEvent() and into
glutMainLoop(), per discussion on the list. The code looks okay, to me, though I remain less than wholly convinced that treating idles as special cases is the best way to go. Still, a case can be made for taking "non-event" idle callbacks out of the "event loop". From an organizational perspective, I think that it's an improvement, and it fixes a bug for at least one program. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@244 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
9f78016727
commit
09723d91eb
@ -1006,12 +1006,6 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
||||
*/
|
||||
fghCheckJoystickPolls();
|
||||
|
||||
/*
|
||||
* No messages in the queue, which means we are idling...
|
||||
*/
|
||||
if( fgState.IdleCallback != NULL )
|
||||
fgState.IdleCallback();
|
||||
|
||||
/*
|
||||
* Remember about displaying all the windows that have
|
||||
* been marked for a redisplay (possibly in the idle call):
|
||||
@ -1052,12 +1046,6 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
||||
*/
|
||||
fghCheckJoystickPolls();
|
||||
|
||||
/*
|
||||
* No messages in the queue, which means we are idling...
|
||||
*/
|
||||
if( fgState.IdleCallback != NULL )
|
||||
fgState.IdleCallback();
|
||||
|
||||
/*
|
||||
* Remember about displaying all the windows that have
|
||||
* been marked for a redisplay (possibly in the idle call):
|
||||
@ -1136,7 +1124,11 @@ void FGAPIENTRY glutMainLoop( void )
|
||||
if ( fgStructure.Windows.First == NULL )
|
||||
fgState.ExecState = GLUT_EXEC_STATE_STOP ;
|
||||
else
|
||||
{
|
||||
if ( fgState.IdleCallback )
|
||||
fgState.IdleCallback ();
|
||||
fgSleepForEvents();
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
Reference in New Issue
Block a user