"*useSHM: True \n" \
"*desktopGrabber: xscreensaver-getimage -no-desktop %s\n" \
"*grabDesktopImages: True \n" \
- "*chooseRandomImages: True \n"
+ "*chooseRandomImages: True \n" \
+ "*suppressRotationAnimation: True\n" \
# define refresh_mirrorblob 0
-/*
-# define mirrorblob_handle_event 0
-*/
+# define release_mirrorblob 0
# include "xlockmore.h"
#else /* !STANDALONE */
# include "xlock.h" /* from the xlockmore distribution */
#ifdef USE_MODULES
ModStruct mirrorblob_description =
-{"mirrorblob", "init_mirrorblob", "draw_mirrorblob", "release_mirrorblob",
+{"mirrorblob", "init_mirrorblob", "draw_mirrorblob", NULL,
"draw_mirrorblob", "init_mirrorblob", "handle_event", &mirrorblob_opts,
1000, 1, 2, 1, 4, 1.0, "",
"OpenGL mirrorblob", 0, NULL};
*
* Return the magnitude of the given vector
*/
+#if 0
static inline double
length (Vector3D u)
{
return sqrt (u.x * u.x + u.y * u.y + u.z * u.z);
}
+#endif
/******************************************************************************
*
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glRotatef(current_device_rotation(), 0, 0, 1);
+/* glRotatef(current_device_rotation(), 0, 0, 1); */
/* Move down the z-axis. */
glTranslatef (0.0, 0.0, -4.0);
glPushMatrix();
glLoadIdentity();
- glRotatef (rot, 0, 0, 1);
+ glRotatef (-rot, 0, 0, 1);
+/*
if ((rot > 45 && rot < 135) ||
(rot < -45 && rot > -135))
{
GLfloat s = MI_WIDTH(mi) / (GLfloat) MI_HEIGHT(mi);
glScalef (s, 1/s, 1);
}
+*/
glOrtho(0.0, MI_WIDTH(mi), MI_HEIGHT(mi), 0.0, -1000.0, 1000.0);
mirrorblobstruct *gp = &Mirrorblob[MI_SCREEN (mi)];
if (event->xany.type == ButtonPress &&
- event->xbutton.button == Button1)
- {
- gp->button_down = 1;
- gltrackball_start (gp->trackball, event->xbutton.x,
- event->xbutton.y, MI_WIDTH (mi), MI_HEIGHT (mi));
- return True;
- }
- else if (event->xany.type == ButtonRelease &&
- event->xbutton.button == Button1)
- {
- gp->button_down = 0;
- return True;
- }
- else if (event->xany.type == ButtonPress &&
- event->xbutton.button == Button4)
+ event->xbutton.button == Button4)
{
zoom *= 1.1;
return True;
zoom *= 0.9;
return True;
}
- else if (event->xany.type == MotionNotify && gp->button_down)
+ else if (gltrackball_event_handler (event, gp->trackball,
+ MI_WIDTH (mi), MI_HEIGHT (mi),
+ &gp->button_down))
+ {
+ return True;
+ }
+ else if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
{
- gltrackball_track (gp->trackball, event->xmotion.x,
- event->xmotion.y, MI_WIDTH (mi), MI_HEIGHT (mi));
+ gp->state_start_time = 0;
+ gp->state = HOLDING;
return True;
}
+
return False;
}
+static void free_mirrorblob(ModeInfo * mi);
+
/******************************************************************************
*
* XMirrorblob initialise entry
mirrorblobstruct *gp;
- if (Mirrorblob == NULL)
- {
- if ((Mirrorblob = (mirrorblobstruct *)
- calloc(MI_NUM_SCREENS(mi), sizeof (mirrorblobstruct))) == NULL)
- {
- return;
- }
- }
+ MI_INIT(mi, Mirrorblob, free_mirrorblob);
gp = &Mirrorblob[screen];
gp->window = MI_WINDOW(mi);
{
MI_CLEARWINDOW(mi);
}
- gp->trackball = gltrackball_init();
+ gp->trackball = gltrackball_init(False);
initialise_blob(gp, MI_WIDTH(mi), MI_HEIGHT(mi), BUMP_ARRAY_SIZE);
gp->state = INITIALISING;
*
* XMirrorblob cleanup entry
*/
-ENTRYPOINT void
-release_mirrorblob(ModeInfo * mi)
+static void
+free_mirrorblob(ModeInfo * mi)
{
- if (Mirrorblob != NULL) {
- int i;
- for (i = 0; i < MI_NUM_SCREENS(mi); i++) {
- mirrorblobstruct *gp = &Mirrorblob[i];
- if (gp->nodes) free(gp->nodes);
- if (gp->faces) free(gp->faces);
- if (gp->bump_data) free(gp->bump_data);
- if (gp->colours) free(gp->colours);
- if (gp->tex_coords) free(gp->tex_coords);
- if (gp->dots) free(gp->dots);
- if (gp->wall_shape) free(gp->wall_shape);
- if (gp->bump_shape) free(gp->bump_shape);
- }
-
- free(Mirrorblob);
- Mirrorblob = NULL;
- }
- FreeAllGL(mi);
+ mirrorblobstruct *gp = &Mirrorblob[MI_SCREEN(mi)];
+ if (gp->nodes) free(gp->nodes);
+ if (gp->faces) free(gp->faces);
+ if (gp->bump_data) free(gp->bump_data);
+ if (gp->colours) free(gp->colours);
+ if (gp->tex_coords) free(gp->tex_coords);
+ if (gp->dots) free(gp->dots);
+ if (gp->wall_shape) free(gp->wall_shape);
+ if (gp->bump_shape) free(gp->bump_shape);
}
XSCREENSAVER_MODULE ("MirrorBlob", mirrorblob)