diff --git a/freeglut/freeglut/src/freeglut_main.c b/freeglut/freeglut/src/freeglut_main.c index 396de79..f6c2239 100644 --- a/freeglut/freeglut/src/freeglut_main.c +++ b/freeglut/freeglut/src/freeglut_main.c @@ -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(); + } } {