#define countof(x) (sizeof((x))/sizeof((*x)))
#include "xlockmore.h"
+#include "glxfonts.h"
static XrmOptionDescRec opts[] = {
{ "-explode", ".explode", XrmoptionSepArg, DEF_EXPLODE },
#endif /* !HAVE_GETTIMEOFDAY */
}
-#ifndef HAVE_GLUT
-static void load_font(ModeInfo * mi, char * res, XFontStruct ** fontp, GLuint * dlistp) {
- const char * font = get_string_resource(res, "Font");
- XFontStruct * f;
- Font id;
- int first, last;
-
- if (!font)
- font = "-*-helvetica-medium-r-*-*-*-120-*";
-
- f = XLoadQueryFont(mi->dpy, font);
- if (!f)
- f = XLoadQueryFont(mi->dpy, "fixed");
-
- id = f->fid;
- first = f->min_char_or_byte2;
- last = f->max_char_or_byte2;
-
- clear_gl_error();
- *dlistp = glGenLists((GLuint) last + 1);
- check_gl_error("glGenLists");
- glXUseXFont(id, first, last - first + 1, *dlistp + first);
- check_gl_error("glXUseXFont");
-
- *fontp = f;
-}
-#endif
void start_morph(int model_index, int immediate);
/* set up a font for the labels */
#ifndef HAVE_GLUT
if (titles)
- load_font(mi, "labelfont", &bp->font, &bp->font_list);
+ load_font(mi->dpy, "labelfont", &bp->font, &bp->font_list);
#endif
/* build a solid display list */
{
char interactstr[] = "interactive";
char * s;
- int i = 0;
-#ifdef HAVE_GLUT
- int w;
-#endif
-
if (interactive)
s = interactstr;
else
s = model[glc->next_model].name;
-#ifdef HAVE_GLUT
- w = glutBitmapLength(GLUT_BITMAP_HELVETICA_12, (unsigned char *) s);
- glRasterPos2f(glc->width - w - 3, 4);
- while (s[i] != '\0')
- glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, s[i++]);
-#else
- glRasterPos2f(10, mi->xgwa.height - 10 - (bp->font->ascent + bp->font->descent));
- while (s[i] != '\0')
- glCallList(bp->font_list + (int)s[i++]);
-#endif
+
+ print_gl_string (mi->dpy, bp->font, bp->font_list,
+ mi->xgwa.width, mi->xgwa.height,
+ 10, mi->xgwa.height - 10,
+ s);
}
glPopMatrix();
glMatrixMode(GL_PROJECTION);