X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fatlantis.c;h=1d9deab8e92a28253df122c8eeb5f4496d49ddf4;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=ba648877204eaff27f8f7be3666eb2e4758e93b1;hpb=5f9c47ca98dd43d8f59b7c27d3fde6edfde4fe21;p=xscreensaver diff --git a/hacks/glx/atlantis.c b/hacks/glx/atlantis.c index ba648877..1d9deab8 100644 --- a/hacks/glx/atlantis.c +++ b/hacks/glx/atlantis.c @@ -271,8 +271,6 @@ Init(ModeInfo *mi) } else { - GLfloat s_plane[] = { 1, 0, 0, 0 }; - GLfloat t_plane[] = { 0, 0, 1, 0 }; GLfloat scale = 0.0005; if (!ap->texture) @@ -292,13 +290,18 @@ Init(ModeInfo *mi) glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); - glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); - glTexGenfv(GL_S, GL_EYE_PLANE, s_plane); - glTexGenfv(GL_T, GL_EYE_PLANE, t_plane); - - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); +# ifndef HAVE_JWZGLES + { + GLfloat s_plane[] = { 1, 0, 0, 0 }; + GLfloat t_plane[] = { 0, 0, 1, 0 }; + glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); + glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); + glTexGenfv(GL_S, GL_EYE_PLANE, s_plane); + glTexGenfv(GL_T, GL_EYE_PLANE, t_plane); + glEnable(GL_TEXTURE_GEN_S); + glEnable(GL_TEXTURE_GEN_T); + } +# endif glEnable(GL_TEXTURE_2D); glMatrixMode(GL_TEXTURE); @@ -340,8 +343,8 @@ clear_tank (atlantisstruct * ap) if (do_gradient && !ap->wire) { - GLfloat top[3] = { 0.00, 0.40, 0.70 }; - GLfloat bot[3] = { 0.00, 0.05, 0.18 }; + GLfloat top[4] = { 0.00, 0.40, 0.70, }; + GLfloat bot[4] = { 0.00, 0.05, 0.18, }; glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -351,26 +354,19 @@ clear_tank (atlantisstruct * ap) 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(); + /* 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); } glPopMatrix(); } @@ -521,8 +517,11 @@ draw_atlantis(ModeInfo * mi) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glPushMatrix(); + glRotatef(current_device_rotation(), 0, 0, 1); AllDisplay(ap); Animate(ap); + glPopMatrix(); if (mi->fps_p) do_fps (mi); glXSwapBuffers(display, window);