X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2Fshapes%2Fshapes.c;h=b2da232a74b94ee4ad714ca177d48348a74d0786;hb=ea5dc8a10beb55cd972c34d6b531158101b6773f;hp=6942c77ad544c51276ae35f2e8ed68b186fdc74e;hpb=a1341b0b3cbc2010781cf82d86ed60d5e0eb300a;p=freeglut diff --git a/progs/demos/shapes/shapes.c b/progs/demos/shapes/shapes.c index 6942c77..b2da232 100644 --- a/progs/demos/shapes/shapes.c +++ b/progs/demos/shapes/shapes.c @@ -420,6 +420,7 @@ static float ar; static GLboolean persProject = GL_TRUE; static GLboolean animateXRot = GL_FALSE; static GLboolean useShader = GL_FALSE; +static GLboolean visNormals = GL_FALSE; /* * These one-liners draw particular objects, fetching appropriate @@ -541,7 +542,7 @@ static const entry table [] = ENTRY (Sphere), ENTRY (Cone), ENTRY (Cylinder), - ENTRY (Cuboctahedron) + ENTRY (Cuboctahedron) /* This one doesn't work when in shader mode and is then skipped */ }; #undef ENTRY @@ -659,6 +660,7 @@ static void display(void) else { /* fixed function pipeline */ + glutSetOption(GLUT_OBJECTS_VISUALIZE_NORMALS,visNormals); /* Normals visualized or not? */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); if (persProject) @@ -709,6 +711,8 @@ static void display(void) shapesPrintf (9, 1, "2D rotation (r)"); else shapesPrintf (9, 1, "1D rotation (r)"); + if (!useShader) + shapesPrintf (10, 1, "visualizing normals: %i (n)",visNormals); } else { /* print to command line instead */ printf ( "Shape %d slides %d stacks %d\n", function_index, slices, stacks ) ; @@ -757,6 +761,9 @@ key(unsigned char key, int x, int y) case 'S': case 's': useShader=!useShader; break; + case 'N': + case 'n': visNormals=!visNormals; break; + default: break; }