- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(400.0, (GLdouble) width / (GLdouble) height, 1.0, 2000000.0);
- glMatrixMode(GL_MODELVIEW);
+/* 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[4] = { 0.00, 0.40, 0.70, };
+ GLfloat bot[4] = { 0.00, 0.05, 0.18, };
+
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ {
+ glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ {
+ glLoadIdentity();
+ /* glRotatef(current_device_rotation(), 0, 0, 1); */
+
+# ifndef HAVE_JWZGLES
+ glShadeModel (GL_SMOOTH);
+# endif
+ glDisable (GL_LIGHTING);
+ glBegin (GL_QUADS);
+ glColor3fv (bot);
+ glVertex3f (-1, -1, 1); glVertex3f ( 1, -1, 1);
+ glColor3fv (top);
+ glVertex3f ( 1, 1, 1); glVertex3f (-1, 1, 1);
+ glEnd();
+ glEnable (GL_LIGHTING);
+
+ /* Need to reset this because jwzgles conflates color and material */
+ glColor3f (0.0, 0.1, 0.2);
+ }
+ glPopMatrix();
+ }
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+
+ glMatrixMode(GL_MODELVIEW);
+ }