From http://www.jwz.org/xscreensaver/xscreensaver-5.18.tar.gz
[xscreensaver] / hacks / glx / cubicgrid.c
index 7060bcf5d7b1bfe9482de736128c30e08f5a7dfc..400af7437f27eb6a2641ae39fdc58b05847b4e35 100644 (file)
@@ -141,7 +141,12 @@ static Bool draw_main(cubicgrid_conf *cp)
   glTranslatef(0, 0, zpos);
 
   glScalef(size/ticks, size/ticks, size/ticks);
+
+  /* Do it twice because we don't track the device's orientation. */
+  glRotatef( current_device_rotation(), 0, 0, 1);
   gltrackball_rotate (cp->trackball);
+  glRotatef(-current_device_rotation(), 0, 0, 1);
+
   get_rotation (cp->rot, &x, &y, &z, !cp->button_down_p);
   glRotatef (x * 360, 1.0, 0.0, 0.0);
   glRotatef (y * 360, 0.0, 1.0, 0.0);
@@ -158,7 +163,6 @@ static void init_gl(ModeInfo *mi)
   int x, y, z;
   float tf = ticks;
 
-  glClearColor(0.0, 0.0, 0.0, 1.0);
   glDrawBuffer(GL_BACK);
   if(bigdots) {
     glPointSize(2.0);