#define DEFAULTS "*delay: 20000\n" \
"*showFPS: False\n" \
"*mode: grab\n" \
- "*useSHM: True \n"
-
+ "*useSHM: True \n" \
+ "*suppressRotationAnimation: True\n" \
# define refresh_gflux 0
+# define release_gflux 0
# include "xlockmore.h" /* from the xscreensaver distribution */
#else /* !STANDALONE */
# include "xlock.h" /* from the xlockmore distribution */
#ifdef USE_MODULES
ModStruct gflux_description =
-{"gflux", "init_gflux", "draw_gflux", "release_gflux",
+{"gflux", "init_gflux", "draw_gflux", NULL,
"draw_gflux", "init_gflux", NULL, &gflux_opts,
1000, 1, 2, 1, 4, 1.0, "",
"GFlux: an OpenGL gflux", 0, NULL};
}
-/* reset the projection matrix */
-static void resetProjection(void)
+/* Standard reshape function */
+ENTRYPOINT void
+reshape_gflux(ModeInfo *mi, int width, int height)
{
+ glViewport( 0, 0, width, height );
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-_zoom,_zoom,-0.8*_zoom,0.8*_zoom,2,6);
glTranslatef(0.0,0.0,-4.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
-}
-/* Standard reshape function */
-ENTRYPOINT void
-reshape_gflux(ModeInfo *mi, int width, int height)
-{
- glViewport( 0, 0, width, height );
- resetProjection();
+# 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
}
int screen = MI_SCREEN(mi);
gfluxstruct *gp;
- if (gfluxes == NULL) {
- if ((gfluxes = (gfluxstruct *)
- calloc(MI_NUM_SCREENS(mi), sizeof (gfluxstruct))) == NULL)
- return;
- }
+ MI_INIT(mi, gfluxes, NULL);
gp = &gfluxes[screen];
gp->trackball = gltrackball_init (True);
}
}
-/* cleanup code */
-ENTRYPOINT void release_gflux(ModeInfo * mi)
-{
- if (gfluxes != NULL) {
- free((void *) gfluxes);
- gfluxes = NULL;
- }
- FreeAllGL(mi);
-}
-
static void createTexture(gfluxstruct *gp)
{