From: Nigel Stewart Date: Tue, 30 Dec 2003 02:14:54 +0000 (+0000) Subject: fgState.FPSInterval is unsigned int (GLuint), environment variable GLUT_FPS can be... X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=acc07c33a660243fece1e72b658c4228a70bea33;p=freeglut fgState.FPSInterval is unsigned int (GLuint), environment variable GLUT_FPS can be negative git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@425 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 0289ddd..c9e85c5 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -519,9 +519,13 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) const char *fps = getenv( "GLUT_FPS" ); if( fps ) { - sscanf( fps, "%d", &fgState.FPSInterval ); - if( fgState.FPSInterval <= 0 ) - fgState.FPSInterval = 5000; /* 5000 milliseconds */ + int interval; + sscanf( fps, "%d", &interval ); + + if( interval <= 0 ) + fgState.FPSInterval = 5000; /* 5000 millisecond default */ + else + fgState.FPSInterval = interval; } }