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)
(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();
}
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);