# define MODE_moebius
# define DEFAULTS "*delay: 40000 \n" \
"*showFPS: False \n" \
- "*count: 0 \n"
+ "*count: 0 \n" \
+ "*suppressRotationAnimation: True\n" \
+
# define refresh_morph3d 0
+# define release_morph3d 0
# define morph3d_handle_event 0
# include "xlockmore.h" /* from the xscreensaver distribution */
#else /* !STANDALONE */
#ifdef USE_MODULES
ModStruct morph3d_description =
-{"morph3d", "init_morph3d", "draw_morph3d", "release_morph3d",
+{"morph3d", "init_morph3d", "draw_morph3d", (char *) NULL,
"draw_morph3d", "change_morph3d", (char *) NULL, &morph3d_opts,
1000, 0, 1, 1, 4, 1.0, "",
"Shows GL morphing polyhedra", 0, NULL};
morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
glClearDepth(1.0);
- glClearColor(0.0, 0.0, 0.0, 1.0);
glColor3f(1.0, 1.0, 1.0);
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
{
morph3dstruct *mp;
- if (morph3d == NULL) {
- if ((morph3d = (morph3dstruct *) calloc(MI_NUM_SCREENS(mi),
- sizeof (morph3dstruct))) == NULL)
- return;
- }
+ MI_INIT (mi, morph3d, NULL);
mp = &morph3d[MI_SCREEN(mi)];
mp->step = NRAND(90);
mp->VisibleSpikes = 1;
glScalef(Scale4Iconic * mp->WindH / mp->WindW, Scale4Iconic, Scale4Iconic);
}
+# 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, h, 1);
+ }
+# endif
+
glRotatef(mp->step * 100, 1, 0, 0);
glRotatef(mp->step * 95, 0, 1, 0);
glRotatef(mp->step * 90, 0, 0, 1);
}
#endif /* !STANDALONE */
-ENTRYPOINT void
-release_morph3d(ModeInfo * mi)
-{
- if (morph3d != NULL) {
- (void) free((void *) morph3d);
- morph3d = (morph3dstruct *) NULL;
- }
- FreeAllGL(mi);
-}
-
#endif
XSCREENSAVER_MODULE ("Morph3D", morph3d)