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:
parent
e6b59a4b45
commit
d8b2c1d571
@ -64,16 +64,19 @@ void FGAPIENTRY glutSwapBuffers( void )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* GLUT_FPS env var support */
|
/* GLUT_FPS env var support */
|
||||||
if (fgState.FPSInterval) {
|
if( fgState.FPSInterval )
|
||||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
{
|
||||||
|
GLint t = glutGet( GLUT_ELAPSED_TIME );
|
||||||
fgState.SwapCount++;
|
fgState.SwapCount++;
|
||||||
if (fgState.SwapTime == 0)
|
if( fgState.SwapTime == 0 )
|
||||||
fgState.SwapTime = t;
|
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;
|
float time = 0.001f * ( t - fgState.SwapTime );
|
||||||
fprintf(stderr, "freeglut: %d frames in %.2f seconds = %.2f FPS\n",
|
float fps = ( float )fgState.SwapCount / time;
|
||||||
fgState.SwapCount, time, fps);
|
fprintf( stderr,
|
||||||
|
"freeglut: %d frames in %.2f seconds = %.2f FPS\n",
|
||||||
|
fgState.SwapCount, time, fps );
|
||||||
fgState.SwapTime = t;
|
fgState.SwapTime = t;
|
||||||
fgState.SwapCount = 0;
|
fgState.SwapCount = 0;
|
||||||
}
|
}
|
||||||
@ -89,7 +92,7 @@ void FGAPIENTRY glutPostWindowRedisplay( int windowID )
|
|||||||
|
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
window = fgWindowByID( windowID );
|
window = fgWindowByID( windowID );
|
||||||
freeglut_return_if_fail( window != NULL );
|
freeglut_return_if_fail( window );
|
||||||
window->State.Redisplay = TRUE;
|
window->State.Redisplay = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user