X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fgltrackball.c;h=d02e316ae62e85a1b9f1cade3f3055bcca0b7013;hb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;hp=e3c0cd42402fdb781b03a48a0be8e502d4c7f9c9;hpb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b;p=xscreensaver diff --git a/hacks/glx/gltrackball.c b/hacks/glx/gltrackball.c index e3c0cd42..d02e316a 100644 --- a/hacks/glx/gltrackball.c +++ b/hacks/glx/gltrackball.c @@ -12,6 +12,7 @@ #include #include +#include #ifdef HAVE_CONFIG_H # include "config.h" @@ -43,6 +44,15 @@ gltrackball_init (void) return ts; } +/* Reset the trackball to the default unrotated state. + */ +void +gltrackball_reset (trackball_state *ts) +{ + memset (ts, 0, sizeof(*ts)); + trackball (ts->q, 0, 0, 0, 0); +} + /* Begin tracking the mouse: Call this when the mouse button goes down. x and y are the mouse position relative to the window. w and h are the size of the window.