fgState.FPSInterval is unsigned int (GLuint), environment variable GLUT_FPS can be...
authorNigel Stewart <nigels.com@gmail.com>
Tue, 30 Dec 2003 02:14:54 +0000 (02:14 +0000)
committerNigel Stewart <nigels.com@gmail.com>
Tue, 30 Dec 2003 02:14:54 +0000 (02:14 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@425 7f0cb862-5218-0410-a997-914c9d46530a

src/freeglut_init.c

index 0289ddd..c9e85c5 100644 (file)
@@ -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;
         }
     }