From a1341b0b3cbc2010781cf82d86ed60d5e0eb300a Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Sun, 18 Nov 2012 03:30:54 +0000 Subject: [PATCH] small enhancements to shapes demo: - pitch and yaw rotation speeds are now prime numbers so we don't have a repeating cycle - made window slightly larger so we have more space for the info printed - added info for 2D rotation vs 1D rotation - added keys to info where they were missing git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1400 7f0cb862-5218-0410-a997-914c9d46530a --- progs/demos/shapes/shapes.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/progs/demos/shapes/shapes.c b/progs/demos/shapes/shapes.c index c22c055..6942c77 100644 --- a/progs/demos/shapes/shapes.c +++ b/progs/demos/shapes/shapes.c @@ -604,8 +604,8 @@ resize(int width, int height) static void display(void) { const double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0; - const double a = t*90.0; - const double b = (animateXRot?t:1)*60.0; + const double a = t*89.0; + const double b = (animateXRot?t:1)*67.0; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -698,14 +698,19 @@ static void display(void) shapesPrintf (5, 1, "Outer radius Up Down : %f", orad); shapesPrintf (6, 1, "Inner radius Left Right: %f", irad); if (persProject) - shapesPrintf (7, 1, "Perspective projection"); + shapesPrintf (7, 1, "Perspective projection (p)"); else - shapesPrintf (7, 1, "Orthographic projection"); + shapesPrintf (7, 1, "Orthographic projection (p)"); if (useShader) - shapesPrintf (8, 1, "Using shader"); + shapesPrintf (8, 1, "Using shader (s)"); else - shapesPrintf (8, 1, "Using fixed function pipeline"); + shapesPrintf (8, 1, "Using fixed function pipeline (s)"); + if (animateXRot) + shapesPrintf (9, 1, "2D rotation (r)"); + else + shapesPrintf (9, 1, "1D rotation (r)"); } else { + /* print to command line instead */ printf ( "Shape %d slides %d stacks %d\n", function_index, slices, stacks ) ; } @@ -804,7 +809,7 @@ const GLfloat high_shininess[] = { 100.0f }; int main(int argc, char *argv[]) { - glutInitWindowSize(640,480); + glutInitWindowSize(800,600); glutInitWindowPosition(40,40); glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_MULTISAMPLE); -- 1.7.10.4