+
+/* Fill the background with a gradient -- thanks to
+ Phil Carrig <pod@internode.on.net> for figuring out
+ how to do this more efficiently!
+ */
+static void
+clear_tank (atlantisstruct * ap)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ if (do_gradient && !ap->wire)
+ {
+ GLfloat top[3] = { 0.00, 0.40, 0.70 };
+ GLfloat bot[3] = { 0.00, 0.05, 0.18 };
+
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ {
+ glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ {
+ glLoadIdentity();
+
+ /* save GL_COLOR_MATERIAL, GL_COLOR_MATERIAL_FACE, etc.
+ This stalls the pipeline, so it would be better to do this
+ with explicit enable/disable calls, but I can't figure
+ out how to undo the glEnable() and glColor() calls below!
+ Simply calling glDisable(GL_COLOR_MATERIAL) is insufficient!
+ */
+ glPushAttrib (GL_LIGHTING_BIT);
+ {
+ glEnable (GL_COLOR_MATERIAL);
+
+ glShadeModel(GL_SMOOTH);
+ glBegin(GL_QUADS);
+ glColor3f (bot[0], bot[1], bot[2]); glVertex3f (-1, -1, 1);
+ glColor3f (bot[0], bot[1], bot[2]); glVertex3f ( 1, -1, 1);
+ glColor3f (top[0], top[1], top[2]); glVertex3f ( 1, 1, 1);
+ glColor3f (top[0], top[1], top[2]); glVertex3f (-1, 1, 1);
+ glEnd();
+ }
+ glPopAttrib();
+ }
+ glPopMatrix();
+ }
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+
+ glMatrixMode(GL_MODELVIEW);
+ }
+}
+
+