projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.18.tar.gz
[xscreensaver]
/
hacks
/
glx
/
dangerball.c
diff --git
a/hacks/glx/dangerball.c
b/hacks/glx/dangerball.c
index a882500a15bf54b6959af936f551e19e92412b23..7b709092580fd76e24434a116e7c3e3c59700194 100644
(file)
--- a/
hacks/glx/dangerball.c
+++ b/
hacks/glx/dangerball.c
@@
-1,4
+1,4
@@
-/* dangerball, Copyright (c) 2001-200
4
Jamie Zawinski <jwz@jwz.org>
+/* dangerball, Copyright (c) 2001-200
8
Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@
-39,6
+39,7
@@
#define SPHERE_SLICES 32 /* how densely to render spheres */
#define SPHERE_STACKS 16
#define SPHERE_SLICES 32 /* how densely to render spheres */
#define SPHERE_STACKS 16
+
typedef struct {
GLXContext *glx_context;
rotator *rot;
typedef struct {
GLXContext *glx_context;
rotator *rot;
@@
-196,7
+197,9
@@
ball_handle_event (ModeInfo *mi, XEvent *event)
}
else if (event->xany.type == ButtonPress &&
(event->xbutton.button == Button4 ||
}
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);
{
gltrackball_mousewheel (bp->trackball, event->xbutton.button, 10,
!!event->xbutton.state);
@@
-228,8
+231,6
@@
init_ball (ModeInfo *mi)
fprintf(stderr, "%s: out of memory\n", progname);
exit(1);
}
fprintf(stderr, "%s: out of memory\n", progname);
exit(1);
}
-
- bp = &bps[MI_SCREEN(mi)];
}
bp = &bps[MI_SCREEN(mi)];
}
bp = &bps[MI_SCREEN(mi)];
@@
-335,7
+336,10
@@
draw_ball (ModeInfo *mi)
(y - 0.5) * 8,
(z - 0.5) * 15);
(y - 0.5) * 8,
(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 (bp->trackball);
gltrackball_rotate (bp->trackball);
+ glRotatef(-current_device_rotation(), 0, 0, 1);
get_rotation (bp->rot, &x, &y, &z, !bp->button_down_p);
glRotatef (x * 360, 1.0, 0.0, 0.0);
get_rotation (bp->rot, &x, &y, &z, !bp->button_down_p);
glRotatef (x * 360, 1.0, 0.0, 0.0);