From http://www.jwz.org/xscreensaver/xscreensaver-5.37.tar.gz
[xscreensaver] / hacks / glx / geodesic.c
index 383e3045d0b6a7be2cf8eb4da00b671c59e4a623..6f4ed4bf1af9d261297ea359ea11e51257700d87 100644 (file)
@@ -11,7 +11,8 @@
 
 #define DEFAULTS       "*delay:        30000       \n" \
                        "*count:        4           \n" \
-                       "*showFPS:      False       \n"
+                       "*showFPS:      False       \n" \
+                       "*suppressRotationAnimation: True\n" \
 
 # define refresh_geodesic 0
 # define release_geodesic 0
@@ -468,6 +469,14 @@ reshape_geodesic (ModeInfo *mi, int width, int height)
              0.0, 0.0, 0.0,
              0.0, 1.0, 0.0);
 
+# 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
+
   glClear(GL_COLOR_BUFFER_BIT);
 }
 
@@ -479,14 +488,7 @@ init_geodesic (ModeInfo *mi)
   geodesic_configuration *bp;
   int wire = MI_IS_WIREFRAME(mi);
 
-  if (!bps) {
-    bps = (geodesic_configuration *)
-      calloc (MI_NUM_SCREENS(mi), sizeof (geodesic_configuration));
-    if (!bps) {
-      fprintf(stderr, "%s: out of memory\n", progname);
-      exit(1);
-    }
-  }
+  MI_INIT (mi, bps, NULL);
 
   bp = &bps[MI_SCREEN(mi)];