From 502504de2336a64698be544c83697632e4628138 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 1 Jun 2005 07:02:23 +0000 Subject: Add a mode to test flat shading + separate specular. --- progs/demos/spectex.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/progs/demos/spectex.c b/progs/demos/spectex.c index cfa7f74a21a..6ab1191579c 100644 --- a/progs/demos/spectex.c +++ b/progs/demos/spectex.c @@ -33,6 +33,7 @@ static GLint Mode = 4; static GLfloat Black[4] = {0.0, 0.0, 0.0, 1.0}; static GLfloat White[4] = {1.0, 1.0, 1.0, 1.0}; +static GLboolean smooth = 1; static void Idle(void) @@ -143,9 +144,16 @@ static void Key( unsigned char key, int x, int y ) (void) x; (void) y; switch (key) { - case 27: - exit(0); - break; + case 27: + exit(0); + break; + case 's': + smooth = !smooth; + if (smooth) + glShadeModel(GL_SMOOTH); + else + glShadeModel(GL_FLAT); + break; } glutPostRedisplay(); } @@ -175,6 +183,8 @@ static void Init( void ) glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0); glLightModelfv(GL_LIGHT_MODEL_AMBIENT, Black); + glShadeModel(GL_SMOOTH); + glMaterialfv(GL_FRONT, GL_DIFFUSE, White); glMaterialfv(GL_FRONT, GL_SPECULAR, White); glMaterialf(GL_FRONT, GL_SHININESS, 20.0); -- cgit v1.2.3