summaryrefslogtreecommitdiff
path: root/progs/demos/spectex.c
diff options
context:
space:
mode:
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 cfa7f74a21..6ab1191579 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);