diff --git a/glxgears.c b/glxgears.c index 7498194..e6f6ba2 100644 --- a/glxgears.c +++ b/glxgears.c @@ -1,5 +1,5 @@ /* - * 3-D gear wheels. This program is in the public domain. + * 3-D gear wheels. This program is in the public domain. * * Command line options: * -info print GL implementation information @@ -8,10 +8,10 @@ * * * Brian Paul + * Conversion to GLUT by Mark J. Kilgard + * Other modifications by Lexxy Fox. */ -/* Conversion to GLUT by Mark J. Kilgard */ - #include #include #include @@ -27,8 +27,7 @@ static GLboolean Animate = GL_TRUE; static GLfloat viewDist = 40.0; /** - - Draw a gear wheel. You'll probably want to call this function when + Draw a gear wheel. You'll probably want to call this function when building a display list since we do a lot of trig here. Input: inner_radius - radius of hole at center @@ -36,7 +35,6 @@ static GLfloat viewDist = 40.0; width - width of gear teeth - number of teeth tooth_depth - depth of tooth - **/ static void gear( @@ -214,19 +212,17 @@ static void draw(void) { Frames++; - { - GLint t = glutGet(GLUT_ELAPSED_TIME); - if (t - T0 >= 5000) { - GLfloat seconds = (t - T0) / 1000.0; - GLfloat fps = Frames / seconds; - printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps); - fflush(stdout); - T0 = t; - Frames = 0; - if ((t >= 999.0 * autoexit) && (autoexit)) { - cleanup(); - exit(0); - } + GLint t = glutGet(GLUT_ELAPSED_TIME); + if (t - T0 >= 5000) { + GLfloat seconds = (t - T0) / 1000.0; + GLfloat fps = Frames / seconds; + printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps); + fflush(stdout); + T0 = t; + Frames = 0; + if ((t >= 999.0 * autoexit) && (autoexit)) { + cleanup(); + exit(0); } } }