From 9d190efc04275b9c90f08ce2f70d0f9ff96c583a Mon Sep 17 00:00:00 2001 From: Richard Rauch Date: Sun, 26 Oct 2003 06:13:50 +0000 Subject: [PATCH] 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: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@244 7f0cb862-5218-0410-a997-914c9d46530a --- src/freeglut_main.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 396de79..f6c2239 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -1007,12 +1007,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): */ @@ -1053,12 +1047,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(); + } } { -- 1.7.10.4