*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
XFontStruct *xfont1, *xfont2, *xfont3;
GLuint font1_dlist, font2_dlist, font3_dlist;
XFontStruct *xfont1, *xfont2, *xfont3;
GLuint font1_dlist, font2_dlist, font3_dlist;
load_font (mi->dpy, "titleFont", &bp->xfont1, &bp->font1_dlist);
load_font (mi->dpy, "titleFont2", &bp->xfont2, &bp->font2_dlist);
load_font (mi->dpy, "titleFont3", &bp->xfont3, &bp->font3_dlist);
load_font (mi->dpy, "titleFont", &bp->xfont1, &bp->font1_dlist);
load_font (mi->dpy, "titleFont2", &bp->xfont2, &bp->font2_dlist);
load_font (mi->dpy, "titleFont3", &bp->xfont3, &bp->font3_dlist);
+# else /* !HAVE_GLBITMAP */
+ bp->font1_data = load_texture_font (mi->dpy, "titleFont");
+ bp->font2_data = load_texture_font (mi->dpy, "titleFont2");
+ bp->font3_data = load_texture_font (mi->dpy, "titleFont3");
+# endif /* !HAVE_GLBITMAP */
- print_gl_string (mi->dpy, bp->xfont1, bp->font1_dlist,
+ print_gl_string (mi->dpy,
+# ifdef HAVE_GLBITMAP
+ bp->xfont1, bp->font1_dlist,
+# else /* !HAVE_GLBITMAP */
+ bp->font1_data,
+# endif /* !HAVE_GLBITMAP */
- mi->xgwa.width - (string_width (bp->xfont1, s, 0) + 40),
+ mi->xgwa.width - (
+# ifdef HAVE_GLBITMAP
+ string_width (f, s, 0)
+# else /* !HAVE_GLBITMAP */
+ texture_string_width (f, s, 0)
+# endif /* !HAVE_GLBITMAP */
+ + 40),
char c = 0;
XLookupString (&event->xkey, &c, 1, &keysym, 0);
char c = 0;
XLookupString (&event->xkey, &c, 1, &keysym, 0);
- print_gl_string (mi->dpy, f, fl,
+ print_gl_string (mi->dpy, f,
+# ifdef HAVE_GLBITMAP
+ fl,
+# endif /* HAVE_GLBITMAP */
mi->xgwa.width, mi->xgwa.height,
10, mi->xgwa.height - 10,
label, False);
mi->xgwa.width, mi->xgwa.height,
10, mi->xgwa.height - 10,
label, False);
static void
tess_error (GLenum errorCode)
{
fprintf (stderr, "%s: tesselation error: %s\n",
progname, gluErrorString(errorCode));
static void
tess_error (GLenum errorCode)
{
fprintf (stderr, "%s: tesselation error: %s\n",
progname, gluErrorString(errorCode));
/* Use the GLU polygon tesselator so that nonconvex faces are displayed
correctly (e.g., for the "pentagrammic concave deltohedron").
*/
/* Use the GLU polygon tesselator so that nonconvex faces are displayed
correctly (e.g., for the "pentagrammic concave deltohedron").
*/
GLUtesselator *tobj = gluNewTess();
gluTessCallback (tobj, GLU_TESS_BEGIN, (void (*) (void)) &glBegin);
gluTessCallback (tobj, GLU_TESS_END, (void (*) (void)) &glEnd);
gluTessCallback (tobj, GLU_TESS_VERTEX, (void (*) (void)) &glVertex3dv);
gluTessCallback (tobj, GLU_TESS_ERROR, (void (*) (void)) &tess_error);
GLUtesselator *tobj = gluNewTess();
gluTessCallback (tobj, GLU_TESS_BEGIN, (void (*) (void)) &glBegin);
gluTessCallback (tobj, GLU_TESS_END, (void (*) (void)) &glEnd);
gluTessCallback (tobj, GLU_TESS_VERTEX, (void (*) (void)) &glVertex3dv);
gluTessCallback (tobj, GLU_TESS_ERROR, (void (*) (void)) &tess_error);
glNewList (bp->object_list, GL_COMPILE);
if (bp->which == bp->npolyhedra-1)
{
glNewList (bp->object_list, GL_COMPILE);
if (bp->which == bp->npolyhedra-1)
{
+ GLfloat bcolor[4];
+ bcolor[0] = bp->colors[0].red / 65536.0;
+ bcolor[1] = bp->colors[0].green / 65536.0;
+ bcolor[2] = bp->colors[0].blue / 65536.0;
+ bcolor[3] = 1.0;
+ if (wire)
+ glColor3f (0, 1, 0);
+ else
+ glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, bcolor);
+
glScalef (0.8, 0.8, 0.8);
p->nfaces = unit_teapot (6, wire);
glScalef (0.8, 0.8, 0.8);
p->nfaces = unit_teapot (6, wire);
bcolor[0] = bp->colors[f->color].red / 65536.0;
bcolor[1] = bp->colors[f->color].green / 65536.0;
bcolor[2] = bp->colors[f->color].blue / 65536.0;
bcolor[0] = bp->colors[f->color].red / 65536.0;
bcolor[1] = bp->colors[f->color].green / 65536.0;
bcolor[2] = bp->colors[f->color].blue / 65536.0;
glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, bcolor);
}
kludge_normal (f->npoints, f->points, p->points);
glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, bcolor);
}
kludge_normal (f->npoints, f->points, p->points);
gluTessBeginPolygon (tobj, 0);
gluTessBeginContour (tobj);
for (j = 0; j < f->npoints; j++)
gluTessBeginPolygon (tobj, 0);
gluTessBeginContour (tobj);
for (j = 0; j < f->npoints; j++)
+# else /* !HAVE_TESS */
+ glBegin (wire ? GL_LINE_LOOP :
+ f->npoints == 3 ? GL_TRIANGLES :
+ f->npoints == 4 ? GL_QUADS :
+ GL_POLYGON);
+ for (j = 0; j < f->npoints; j++)
+ {
+ point *pp = &p->points[f->points[j]];
+ glVertex3f (pp->x, pp->y, pp->z);
+ }
+ glEnd();
+# endif /* !HAVE_TESS */
if (!bps) {
bps = (polyhedra_configuration *)
calloc (MI_NUM_SCREENS(mi), sizeof (polyhedra_configuration));
if (!bps) {
bps = (polyhedra_configuration *)
calloc (MI_NUM_SCREENS(mi), sizeof (polyhedra_configuration));
get_rotation (bp->rot, &x, &y, &z, !bp->button_down_p);
glRotatef (x * 360, 1.0, 0.0, 0.0);
get_rotation (bp->rot, &x, &y, &z, !bp->button_down_p);
glRotatef (x * 360, 1.0, 0.0, 0.0);