/* -*- Mode: C; tab-width: 4 -*- */
/* vim: set ai ts=4 sw=4: */
-#if !defined( lint ) && !defined( SABER )
+#if 0
/*static const char sccsid[] = "@(#)gleidescope.c 1.0 03/06/27 xlockmore";*/
#endif
"*delay: 20000 \n" \
"*showFPS: False \n" \
"*size: 0 \n" \
- "*useSHM: True \n"
+ "*useSHM: True \n" \
+ "*suppressRotationAnimation: True\n" \
# define refresh_gleidescope 0
# include "xlockmore.h" /* from the xscreensaver distribution */
printf("event:%d\n", event->xany.type);
printf("button:%d\n", event->xbutton.button);
*/
- switch(event->xany.type)
- {
- case ButtonPress:
-
+ if (event->xany.type == ButtonPress)
+ {
if (event->xbutton.button == Button1 ||
event->xbutton.button == Button3)
{
return True;
}
#endif
- break;
-
- case ButtonRelease:
-
+ } else if (event->xany.type == ButtonRelease)
+ {
if (event->xbutton.button == Button1 ||
event->xbutton.button == Button3)
{
gp->button_down_p = False;
return True;
}
- break;
-
- case MotionNotify:
-
+ } else if (event->xany.type == MotionNotify)
+ {
if (gp->button_down_p)
{
/* update mouse position */
return True;
}
- break;
- }
+ }
+ else if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
+ {
+ gp->start_time = -1;
+ gp->fade = 0;
+ return True;
+ }
return False;
}
{
int polys = 0;
int i;
- GLfloat col[4];
vector2f t[3];
gleidestruct *gp = &gleidescope[MI_SCREEN(mi)];
- col[0] = 1.0;
- col[1] = 1.0;
- col[2] = 1.0;
- col[3] = (float)translucency / MAX_FADE;
-
calculate_texture_coords(mi, texture, t);
glColor4f(1.0, 1.0, 1.0, (float)translucency / MAX_FADE);
GLfloat x_angle, y_angle, z_angle;
gleidestruct *gp = &gleidescope[MI_SCREEN(mi)];
vectorf v1;
- GLfloat pos[4];
mi->polygon_count = 0;
0.0);
#endif
- /* light position same as camera */
- pos[0] = v1.x;
- pos[1] = v1.y;
- pos[2] = v1.z;
- pos[3] = 0;
+# 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 (1/h, 1/h, 1/h);
+ }
+# endif
if (gp->fade == 0)
{
glLoadIdentity();
gluPerspective(50.0, 1/h, 0.1, 2000.0);
glMatrixMode (GL_MODELVIEW);
-
glLineWidth(1);
glPointSize(1);
}