minor changes

This commit is contained in:
Lexxy Fox 2023-11-01 12:25:29 -05:00
parent 36ac54bbaf
commit b4246e35e9

View File

@ -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: * Command line options:
* -info print GL implementation information * -info print GL implementation information
@ -8,10 +8,10 @@
* *
* *
* Brian Paul * Brian Paul
* Conversion to GLUT by Mark J. Kilgard
* Other modifications by Lexxy Fox.
*/ */
/* Conversion to GLUT by Mark J. Kilgard */
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -27,8 +27,7 @@ static GLboolean Animate = GL_TRUE;
static GLfloat viewDist = 40.0; 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. building a display list since we do a lot of trig here.
Input: inner_radius - radius of hole at center Input: inner_radius - radius of hole at center
@ -36,7 +35,6 @@ static GLfloat viewDist = 40.0;
width - width of gear width - width of gear
teeth - number of teeth teeth - number of teeth
tooth_depth - depth of tooth tooth_depth - depth of tooth
**/ **/
static void gear( static void gear(
@ -214,19 +212,17 @@ static void draw(void) {
Frames++; Frames++;
{ GLint t = glutGet(GLUT_ELAPSED_TIME);
GLint t = glutGet(GLUT_ELAPSED_TIME); if (t - T0 >= 5000) {
if (t - T0 >= 5000) { GLfloat seconds = (t - T0) / 1000.0;
GLfloat seconds = (t - T0) / 1000.0; GLfloat fps = Frames / seconds;
GLfloat fps = Frames / seconds; printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps); fflush(stdout);
fflush(stdout); T0 = t;
T0 = t; Frames = 0;
Frames = 0; if ((t >= 999.0 * autoexit) && (autoexit)) {
if ((t >= 999.0 * autoexit) && (autoexit)) { cleanup();
cleanup(); exit(0);
exit(0);
}
} }
} }
} }