diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2005-06-01 07:02:23 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2005-06-01 07:02:23 +0000 |
commit | 502504de2336a64698be544c83697632e4628138 (patch) | |
tree | 7f7386ac81a94e0182f41113a2bfcb27455d45ee /progs | |
parent | f772e3dd1527dcc4a910cbaf3db5ff1a8096740e (diff) | |
download | external_mesa3d-502504de2336a64698be544c83697632e4628138.zip external_mesa3d-502504de2336a64698be544c83697632e4628138.tar.gz external_mesa3d-502504de2336a64698be544c83697632e4628138.tar.bz2 |
Add a mode to test flat shading + separate specular.
Diffstat (limited to 'progs')
-rw-r--r-- | progs/demos/spectex.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/progs/demos/spectex.c b/progs/demos/spectex.c index cfa7f74..6ab1191 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); |