From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / hacks / glx / cubenetic.c
index 5e8c3a042309503b90aa649667ea448a279d98f2..3f92a545323d2e93fa5b6680cf8a8cca36913a1b 100644 (file)
@@ -458,7 +458,7 @@ init_cube (ModeInfo *mi)
     H[2] = ((H[1] + shift) < 360) ? (H[1]+shift) : (H[1] + shift - 360);
     S[0] = S[1] = S[2] = 1.0;
     V[0] = V[1] = V[2] = 1.0;
-    make_color_loop(0, 0,
+    make_color_loop(0, 0, 0,
                    H[0], S[0], V[0], 
                    H[1], S[1], V[1], 
                    H[2], S[2], V[2], 
@@ -560,7 +560,10 @@ draw_cube (ModeInfo *mi)
                  (y - 0.5) * 6,
                  (z - 0.5) * 15);
 
+    /* Do it twice because we don't track the device's orientation. */
+    glRotatef( current_device_rotation(), 0, 0, 1);
     gltrackball_rotate (cc->trackball);
+    glRotatef(-current_device_rotation(), 0, 0, 1);
 
     get_rotation (cc->rot, &x, &y, &z, !cc->button_down_p);
     glRotatef (x * 360, 1.0, 0.0, 0.0);