#define glsnake_init init_glsnake
#define glsnake_display draw_glsnake
#define glsnake_reshape reshape_glsnake
#define glsnake_init init_glsnake
#define glsnake_display draw_glsnake
#define glsnake_reshape reshape_glsnake
static XrmOptionDescRec opts[] = {
{ "-explode", ".explode", XrmoptionSepArg, DEF_EXPLODE },
static XrmOptionDescRec opts[] = {
{ "-explode", ".explode", XrmoptionSepArg, DEF_EXPLODE },
-# ifdef HAVE_GLBITMAP
- load_font(mi->dpy, "labelfont", &bp->font, &bp->font_list);
-# else
- bp->font_data = load_texture_font (mi->dpy, "labelFont");
-# endif
+ bp->font_data = load_texture_font (mi->dpy, "labelfont");
- print_gl_string(mi->dpy,
-# ifdef HAVE_GLBITMAP
- bp->font, bp->font_list,
-# else
- bp->font_data,
-# endif
- mi->xgwa.width, mi->xgwa.height,
- 10.0, (float) mi->xgwa.height - 10.0,
- s, False);
+ print_texture_label (mi->dpy, bp->font_data,
+ mi->xgwa.width, mi->xgwa.height,
+ 1, s);
- glViewport(0, 0, (GLint) w, (GLint) h);
+ double h = (GLfloat) height / (GLfloat) width;
+ int y = 0;
+
+ if (width > height * 5) { /* tiny window: show middle */
+ height = width;
+ y = -height/2;
+ h = height / (GLfloat) width;
+ }
+
+ glViewport(0, y, width, height);
- gluPerspective(zoom, (GLdouble) w / (GLdouble) h, 1.0, 100.0);
+ gluPerspective(zoom, 1/h, 1.0, 100.0);
gluLookAt(0.0, 0.0, 20.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
glMatrixMode(GL_MODELVIEW);
/*gluLookAt(0.0, 0.0, 20.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);*/
glLoadIdentity();
#ifdef HAVE_GLUT
gluLookAt(0.0, 0.0, 20.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
glMatrixMode(GL_MODELVIEW);
/*gluLookAt(0.0, 0.0, 20.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);*/
glLoadIdentity();
#ifdef HAVE_GLUT
glRotatef(yspin, 0.0, 1.0, 0.0);
glRotatef(zspin, 0.0, 0.0, 1.0);
glRotatef(yspin, 0.0, 1.0, 0.0);
glRotatef(zspin, 0.0, 0.0, 1.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
+