"*wireframe: False \n" \
"*showFPS: False \n" \
"*texFontCacheSize: 100 \n" \
+ "*suppressRotationAnimation: True\n" \
"*font: -*-helvetica-medium-r-normal-*-*-160-*-*-*-*-*-*\n" \
# define refresh_geodesic 0
+# define release_geodesic 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
ENTRYPOINT void
reshape_geodesic (ModeInfo *mi, int width, int height)
{
+ geodesic_configuration *bp = &bps[MI_SCREEN(mi)];
GLfloat h = (GLfloat) height / (GLfloat) width;
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(bp->glx_context));
+
glViewport (0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
0.0, 0.0, 0.0,
0.0, 1.0, 0.0);
+# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */
+ {
+ int o = (int) current_device_rotation();
+ if (o != 0 && o != 180 && o != -180)
+ glScalef (1/h, 1/h, 1/h);
+ }
+# endif
+
glClear(GL_COLOR_BUFFER_BIT);
}
}
+static void free_geodesic (ModeInfo *mi);
ENTRYPOINT void
init_geodesic (ModeInfo *mi)
geodesic_configuration *bp;
int wire = MI_IS_WIREFRAME(mi);
- if (!bps) {
- bps = (geodesic_configuration *)
- calloc (MI_NUM_SCREENS(mi), sizeof (geodesic_configuration));
- if (!bps) {
- fprintf(stderr, "%s: out of memory\n", progname);
- exit(1);
- }
- }
+ MI_INIT (mi, bps, free_geodesic);
bp = &bps[MI_SCREEN(mi)];
glXSwapBuffers(dpy, window);
}
-ENTRYPOINT void
-release_geodesic (ModeInfo *mi)
+static void
+free_geodesic (ModeInfo *mi)
{
geodesic_configuration *bp = &bps[MI_SCREEN(mi)];
+ if (!bp->glx_context)
+ return;
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(bp->glx_context));
free_texture_font (bp->font);
free (bp->colors);
free_sphere_gears (mi);