fghSleepForEvents immediately returns if we have an idle callback, so simply don't call the function at all if we just processed the idle callback
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1553 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
7365dc38d4
commit
59ae6d2a56
@ -374,7 +374,7 @@ static void fghSleepForEvents( void )
|
|||||||
{
|
{
|
||||||
fg_time_t msec;
|
fg_time_t msec;
|
||||||
|
|
||||||
if( fgState.IdleCallback || fghHavePendingRedisplays( ) )
|
if( fghHavePendingRedisplays( ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
msec = fghNextTimer( );
|
msec = fghNextTimer( );
|
||||||
@ -447,8 +447,8 @@ void FGAPIENTRY glutMainLoop( void )
|
|||||||
fgSetWindow( window );
|
fgSetWindow( window );
|
||||||
fgState.IdleCallback( );
|
fgState.IdleCallback( );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
fghSleepForEvents( );
|
fghSleepForEvents( );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user