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
/
menger.c
diff --git
a/hacks/glx/menger.c
b/hacks/glx/menger.c
index 03384a45e4611c91fbaa56601969419131b25c15..2319af764055d0a0036dae2ff22dde3324423a76 100644
(file)
--- a/
hacks/glx/menger.c
+++ b/
hacks/glx/menger.c
@@
-363,7
+363,9
@@
sponge_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 (sp->trackball, event->xbutton.button, 5,
!!event->xbutton.state);
{
gltrackball_mousewheel (sp->trackball, event->xbutton.button, 5,
!!event->xbutton.state);
@@
-396,8
+398,6
@@
init_sponge (ModeInfo *mi)
fprintf(stderr, "%s: out of memory\n", progname);
exit(1);
}
fprintf(stderr, "%s: out of memory\n", progname);
exit(1);
}
-
- sp = &sps[MI_SCREEN(mi)];
}
sp = &sps[MI_SCREEN(mi)];
}
sp = &sps[MI_SCREEN(mi)];
@@
-486,7
+486,10
@@
draw_sponge (ModeInfo *mi)
(y - 0.5) * 6,
(z - 0.5) * 15);
(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 (sp->trackball);
gltrackball_rotate (sp->trackball);
+ glRotatef(-current_device_rotation(), 0, 0, 1);
get_rotation (sp->rot, &x, &y, &z, !sp->button_down_p);
glRotatef (x * 360, 1.0, 0.0, 0.0);
get_rotation (sp->rot, &x, &y, &z, !sp->button_down_p);
glRotatef (x * 360, 1.0, 0.0, 0.0);
@@
-526,6
+529,8
@@
draw_sponge (ModeInfo *mi)
? -sp->current_depth : sp->current_depth));
mi->polygon_count = sp->squares_fp; /* for FPS display */
? -sp->current_depth : sp->current_depth));
mi->polygon_count = sp->squares_fp; /* for FPS display */
+ mi->recursion_depth = (sp->current_depth < 0
+ ? -sp->current_depth : sp->current_depth);
}
glScalef (2.0, 2.0, 2.0);
}
glScalef (2.0, 2.0, 2.0);