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.37.tar.gz
[xscreensaver]
/
hacks
/
glx
/
stonerview.c
diff --git
a/hacks/glx/stonerview.c
b/hacks/glx/stonerview.c
index e504709d7b7e0dcff8dd9583b86a4b8f1f10e4b7..6ce58bb05595c1044967fe5fcef7eb275ccc1966 100644
(file)
--- a/
hacks/glx/stonerview.c
+++ b/
hacks/glx/stonerview.c
@@
-25,6
+25,7
@@
"*wireframe: False \n"
# define refresh_stonerview 0
"*wireframe: False \n"
# define refresh_stonerview 0
+# define release_stonerview 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@
-76,19
+77,16
@@
reshape_stonerview (ModeInfo *mi, int width, int height)
}
}
+static void
+free_stonerview (ModeInfo *mi);
+
+
ENTRYPOINT void
init_stonerview (ModeInfo *mi)
{
stonerview_configuration *bp;
ENTRYPOINT void
init_stonerview (ModeInfo *mi)
{
stonerview_configuration *bp;
- if (!bps) {
- bps = (stonerview_configuration *)
- calloc (MI_NUM_SCREENS(mi), sizeof (stonerview_configuration));
- if (!bps) {
- fprintf(stderr, "%s: out of memory\n", progname);
- exit(1);
- }
- }
+ MI_INIT (mi, bps, free_stonerview);
bp = &bps[MI_SCREEN(mi)];
bp = &bps[MI_SCREEN(mi)];
@@
-114,6
+112,15
@@
draw_stonerview (ModeInfo *mi)
glRotatef( current_device_rotation(), 0, 0, 1);
gltrackball_rotate (bp->trackball);
glRotatef( current_device_rotation(), 0, 0, 1);
gltrackball_rotate (bp->trackball);
+# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */
+ {
+ GLfloat h = MI_HEIGHT(mi) / (GLfloat) MI_WIDTH(mi);
+ int o = (int) current_device_rotation();
+ if (o != 0 && o != 180 && o != -180)
+ glScalef (h, h, h);
+ }
+# endif
+
stonerview_win_draw(bp->st);
if (! bp->button_down_p)
stonerview_move_increment(bp->st);
stonerview_win_draw(bp->st);
if (! bp->button_down_p)
stonerview_move_increment(bp->st);
@@
-126,20
+133,12
@@
draw_stonerview (ModeInfo *mi)
glXSwapBuffers(MI_DISPLAY (mi), MI_WINDOW(mi));
}
glXSwapBuffers(MI_DISPLAY (mi), MI_WINDOW(mi));
}
-
ENTRYPOINT
void
-
releas
e_stonerview (ModeInfo *mi)
+
static
void
+
fre
e_stonerview (ModeInfo *mi)
{
{
- if (bps) {
- int screen;
- for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
- stonerview_configuration *bp = &bps[screen];
- if (bp->st)
- stonerview_win_release (bp->st);
- }
- free (bps);
- bps = 0;
- }
- FreeAllGL(mi);
+ stonerview_configuration *bp = &bps[MI_SCREEN(mi)];
+ if (bp->st)
+ stonerview_win_release (bp->st);
}
ENTRYPOINT Bool
}
ENTRYPOINT Bool