X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_display.c;h=a2168a34911a5a9fe15626c4c26ba2687ab1e39a;hb=a7c34bdfaa680a83bf796eac2f2da20b92f4c139;hp=9470c3b234bf4f526d640584b4ccbb982756ac7a;hpb=f5a6203a479c182d2a2fad69186acb1430c53886;p=freeglut diff --git a/src/freeglut_display.c b/src/freeglut_display.c index 9470c3b..a2168a3 100644 --- a/src/freeglut_display.c +++ b/src/freeglut_display.c @@ -29,8 +29,6 @@ #include "config.h" #endif -#define G_LOG_DOMAIN "freeglut-display" - #include "../include/GL/freeglut.h" #include "freeglut_internal.h" @@ -57,7 +55,7 @@ void FGAPIENTRY glutSwapBuffers( void ) glFlush(); if ( ! fgStructure.Window->Window.DoubleBuffered ) - return; + return; #if TARGET_HOST_UNIX_X11 glXSwapBuffers( fgDisplay.Display, fgStructure.Window->Window.Handle ); @@ -66,16 +64,19 @@ void FGAPIENTRY glutSwapBuffers( void ) #endif /* GLUT_FPS env var support */ - if (fgState.FPSInterval) { - GLint t = glutGet(GLUT_ELAPSED_TIME); + if( fgState.FPSInterval ) + { + GLint t = glutGet( GLUT_ELAPSED_TIME ); fgState.SwapCount++; - if (fgState.SwapTime == 0) + if( fgState.SwapTime == 0 ) fgState.SwapTime = t; - 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", - fgState.SwapCount, time, fps); + 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", + fgState.SwapCount, time, fps ); fgState.SwapTime = t; fgState.SwapCount = 0; } @@ -91,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; }