summaryrefslogtreecommitdiffstats
path: root/progs/demos/spectex.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-06-01 07:02:23 +0000
committerKeith Whitwell <[email protected]>2005-06-01 07:02:23 +0000
commit502504de2336a64698be544c83697632e4628138 (patch)
tree7f7386ac81a94e0182f41113a2bfcb27455d45ee /progs/demos/spectex.c
parentf772e3dd1527dcc4a910cbaf3db5ff1a8096740e (diff)
Add a mode to test flat shading + separate specular.
Diffstat (limited to 'progs/demos/spectex.c')
-rw-r--r--progs/demos/spectex.c16
1 files 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);