From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / glx / blocktube.c
index 486db6ff2ca547b188997c66d9df6ae90b7dd05f..51f2f3db758fd2fdc3472cfb5cb089eca43c76cd 100644 (file)
@@ -16,6 +16,7 @@
 #define DEFAULTS        "*delay:       40000           \n" \
                         "*wireframe:    False           \n" \
                        "*showFPS:      False           \n" \
+                       "*suppressRotationAnimation: True\n" \
 
 # define refresh_blocktube 0
 # define blocktube_handle_event 0
@@ -133,8 +134,10 @@ static Bool LoadGLTextures(ModeInfo *mi)
             GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, lp->texti->data);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+# ifndef HAVE_JWZGLES /* #### Sphere maps unimplemented */
         glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
         glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+# endif
     }
     return status;
 }
@@ -319,6 +322,14 @@ ENTRYPOINT void reshape_blocktube (ModeInfo *mi, int width, int height)
     glLoadIdentity();
     gluPerspective(45.0, 1/h, 1.0, 100.0);
     glMatrixMode(GL_MODELVIEW);
+
+# ifdef HAVE_MOBILE    /* Keep it the same relative size when rotated. */
+    {
+      int o = (int) current_device_rotation();
+      if (o != 0 && o != 180 && o != -180)
+        glScalef (1/h, 1/h, 1/h);
+    }
+# endif
 }
 
 static int cube_vertices(float x, float y, float z, int wire)