X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fmoebiusgears.c;h=03381b70d6ae9b81849e34324230f0afadc2f77c;hb=6f5482d73adb0165c0130bb47d852644ab0c4869;hp=67781826ea538ea3ae5f1a3b59608a26d52e625a;hpb=488f2fa8fbdbc77e91a70da2962d73af49e6cace;p=xscreensaver diff --git a/hacks/glx/moebiusgears.c b/hacks/glx/moebiusgears.c index 67781826..03381b70 100644 --- a/hacks/glx/moebiusgears.c +++ b/hacks/glx/moebiusgears.c @@ -1,4 +1,4 @@ -/* moebiusgears, Copyright (c) 2007 Jamie Zawinski +/* moebiusgears, Copyright (c) 2007-2008 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -130,7 +130,9 @@ mgears_handle_event (ModeInfo *mi, XEvent *event) } else if (event->xany.type == ButtonPress && (event->xbutton.button == Button4 || - event->xbutton.button == Button5)) + event->xbutton.button == Button5 || + event->xbutton.button == Button6 || + event->xbutton.button == Button7)) { gltrackball_mousewheel (bp->trackball, event->xbutton.button, 10, !!event->xbutton.state); @@ -164,8 +166,6 @@ init_mgears (ModeInfo *mi) fprintf(stderr, "%s: out of memory\n", progname); exit(1); } - - bp = &bps[MI_SCREEN(mi)]; } bp = &bps[MI_SCREEN(mi)]; @@ -339,7 +339,10 @@ draw_mgears (ModeInfo *mi) (y - 0.5) * 4, (z - 0.5) * 7); + /* Do it twice because we don't track the device's orientation. */ + glRotatef( current_device_rotation(), 0, 0, 1); gltrackball_rotate (bp->trackball); + glRotatef(-current_device_rotation(), 0, 0, 1); get_rotation (bp->rot, &x, &y, &z, !bp->button_down_p);