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.16.tar.gz
[xscreensaver]
/
hacks
/
glx
/
flyingtoasters.c
diff --git
a/hacks/glx/flyingtoasters.c
b/hacks/glx/flyingtoasters.c
index 83e9c9c81d74ccc04b78564262a7945fe2db1610..b9915f5a7fc7c5e3e9c100cee8290bdff4e86e8e 100644
(file)
--- a/
hacks/glx/flyingtoasters.c
+++ b/
hacks/glx/flyingtoasters.c
@@
-323,7
+323,9
@@
toasters_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->user_trackball, event->xbutton.button, 5,
!event->xbutton.state);
{
gltrackball_mousewheel (bp->user_trackball, event->xbutton.button, 5,
!event->xbutton.state);
@@
-360,8
+362,11
@@
load_textures (ModeInfo *mi)
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA,
xi->width, xi->height, 0,
GL_RGBA,
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA,
xi->width, xi->height, 0,
GL_RGBA,
- /* GL_UNSIGNED_BYTE, */
+# ifndef USE_IPHONE
GL_UNSIGNED_INT_8_8_8_8_REV,
GL_UNSIGNED_INT_8_8_8_8_REV,
+# else
+ GL_UNSIGNED_BYTE,
+# endif
xi->data);
check_gl_error("texture");
xi->data);
check_gl_error("texture");
@@
-372,14
+377,19
@@
load_textures (ModeInfo *mi)
glBindTexture (GL_TEXTURE_2D, bp->toast_texture);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glBindTexture (GL_TEXTURE_2D, bp->toast_texture);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+# ifndef HAVE_JWZGLES
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+# endif
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA,
xi->width, xi->height, 0,
GL_RGBA,
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA,
xi->width, xi->height, 0,
GL_RGBA,
- /* GL_UNSIGNED_BYTE, */
+# ifndef USE_IPHONE
GL_UNSIGNED_INT_8_8_8_8_REV,
GL_UNSIGNED_INT_8_8_8_8_REV,
+# else
+ GL_UNSIGNED_BYTE,
+# endif
xi->data);
check_gl_error("texture");
xi->data);
check_gl_error("texture");
@@
-403,8
+413,6
@@
init_toasters (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)];
@@
-476,8
+484,10
@@
init_toasters (ModeInfo *mi)
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, shiny);
if (do_texture)
glBindTexture (GL_TEXTURE_2D, bp->chrome_texture);
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, shiny);
if (do_texture)
glBindTexture (GL_TEXTURE_2D, bp->chrome_texture);
+# ifndef HAVE_JWZGLES
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+# endif
}
else if (i == TOAST || i == TOAST_BITTEN)
{
}
else if (i == TOAST || i == TOAST_BITTEN)
{
@@
-489,8
+499,10
@@
init_toasters (ModeInfo *mi)
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, shiny);
if (do_texture)
glBindTexture (GL_TEXTURE_2D, bp->toast_texture);
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, shiny);
if (do_texture)
glBindTexture (GL_TEXTURE_2D, bp->toast_texture);
+# ifndef HAVE_JWZGLES
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+# endif
glMatrixMode(GL_TEXTURE);
glTranslatef(0.5, 0.5, 0);
glMatrixMode(GL_TEXTURE);
glTranslatef(0.5, 0.5, 0);
@@
-795,9
+807,12
@@
draw_toasters (ModeInfo *mi)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix ();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix ();
+ glRotatef(current_device_rotation(), 0, 0, 1);
glRotatef(bp->view_x, 1, 0, 0);
glRotatef(bp->view_y, 0, 1, 0);
glRotatef(bp->view_x, 1, 0, 0);
glRotatef(bp->view_y, 0, 1, 0);
+ glRotatef(-current_device_rotation(), 0, 0, 1);
gltrackball_rotate (bp->user_trackball);
gltrackball_rotate (bp->user_trackball);
+ glRotatef(current_device_rotation(), 0, 0, 1);
#if 0
#if 0