Further normalization of the code's style. No substantial changes.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@312 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
rkrolib 2003-11-07 07:57:03 +00:00
parent e6b59a4b45
commit d8b2c1d571

View File

@ -64,15 +64,18 @@ void FGAPIENTRY glutSwapBuffers( void )
#endif
/* GLUT_FPS env var support */
if (fgState.FPSInterval) {
if( fgState.FPSInterval )
{
GLint t = glutGet( GLUT_ELAPSED_TIME );
fgState.SwapCount++;
if( fgState.SwapTime == 0 )
fgState.SwapTime = t;
else if (t - fgState.SwapTime > fgState.FPSInterval) {
else if( t - fgState.SwapTime > fgState.FPSInterval )
{
float time = 0.001f * ( t - fgState.SwapTime );
float fps = ( float )fgState.SwapCount / time;
fprintf(stderr, "freeglut: %d frames in %.2f seconds = %.2f FPS\n",
fprintf( stderr,
"freeglut: %d frames in %.2f seconds = %.2f FPS\n",
fgState.SwapCount, time, fps );
fgState.SwapTime = t;
fgState.SwapCount = 0;
@ -89,7 +92,7 @@ void FGAPIENTRY glutPostWindowRedisplay( int windowID )
freeglut_assert_ready;
window = fgWindowByID( windowID );
freeglut_return_if_fail( window != NULL );
freeglut_return_if_fail( window );
window->State.Redisplay = TRUE;
}