+ return polys;
+}
+
+static int
+make_frame (logo_configuration *dc, int wire)
+{
+ int polys = 0;
+ int i, j;
+ GLfloat x[20], y[20];
+ GLfloat corner_cut = 0.5;
+
+ glPushMatrix();
+ glRotatef (90, 0, 1, 0);
+ glScalef (4 * dc->frame_size,
+ 4 * dc->frame_size,
+ 4 * dc->frame_size);
+
+ x[0] = -dc->frame_thickness;
+ x[1] = -dc->frame_thickness * corner_cut;
+ x[2] = 0;
+ x[3] = 0.5 - dc->triangle_size;
+ x[4] = 0.5;
+ x[5] = 0.5 + dc->triangle_size;
+ x[6] = 1;
+ x[7] = 1 + dc->frame_thickness * corner_cut;
+ x[8] = 1 + dc->frame_thickness;
+
+ y[0] = -dc->frame_thickness;
+ y[1] = -dc->frame_thickness * corner_cut;
+ y[2] = 0;
+ y[3] = dc->triangle_size;
+
+ /* front and back
+ */
+ glTranslatef (-0.5, -0.5, dc->frame_depth / 4);
+ if (! wire)
+ for (j = 0; j <= 1; j++)
+ {
+ if (j) glTranslatef (0, 0, -dc->frame_depth / 2);
+ glFrontFace (j ? GL_CCW : GL_CW);
+ for (i = 0; i < 4; i++)
+ {
+ glNormal3f (0, 0, (j ? -1 : 1));
+ glBegin (wire ? GL_LINES : GL_QUAD_STRIP);
+ glVertex3f (x[0], y[1], 0); glVertex3f (x[0], y[2], 0);
+ glVertex3f (x[1], y[0], 0); glVertex3f (x[1], y[2], 0);
+ glVertex3f (x[3], y[0], 0); glVertex3f (x[3], y[2], 0);
+ glVertex3f (x[4], y[0], 0); glVertex3f (x[4], y[3], 0);
+ glVertex3f (x[5], y[0], 0); glVertex3f (x[5], y[2], 0);
+ glVertex3f (x[7], y[0], 0); glVertex3f (x[7], y[2], 0);
+ glVertex3f (x[8], y[1], 0); glVertex3f (x[8], y[2], 0);
+ polys += 6;
+ glEnd ();
+ glTranslatef (0.5, 0.5, 0);
+ glRotatef (90, 0, 0, 1);
+ glTranslatef (-0.5, -0.5, 0);
+ }
+ }
+
+ /* ledges
+ */
+ glFrontFace (GL_CCW);
+ for (i = 0; i < 4; i++)
+ {
+ glNormal3f (0, 1, 0);
+ glBegin (wire ? GL_LINES : GL_QUAD_STRIP);
+ glVertex3f (x[2], y[2], 0); glVertex3f (x[2], y[2], dc->frame_depth/2);
+ glVertex3f (x[3], y[2], 0); glVertex3f (x[3], y[2], dc->frame_depth/2);
+ glVertex3f (x[4], y[3], 0); glVertex3f (x[4], y[3], dc->frame_depth/2);
+ glVertex3f (x[5], y[2], 0); glVertex3f (x[5], y[2], dc->frame_depth/2);
+ glVertex3f (x[6], y[2], 0); glVertex3f (x[6], y[2], dc->frame_depth/2);
+ polys += 4;
+ glEnd ();
+
+ glNormal3f (0, -1, 0);
+ glBegin (wire ? GL_LINE_LOOP : GL_QUADS);
+ glVertex3f (x[7], y[0], 0);
+ glVertex3f (x[7], y[0], dc->frame_depth/2);
+ glVertex3f (x[1], y[0], dc->frame_depth/2);
+ glVertex3f (x[1], y[0], 0);
+ polys++;
+ glEnd ();
+
+ glNormal3f (1, -1, 0);
+ glBegin (wire ? GL_LINE_LOOP : GL_QUADS);
+ glVertex3f (x[8], y[1], 0);
+ glVertex3f (x[8], y[1], dc->frame_depth/2);
+ glVertex3f (x[7], y[0], dc->frame_depth/2);
+ glVertex3f (x[7], y[0], 0);
+ polys++;
+ glEnd ();
+
+ if (wire)
+ {
+ glNormal3f (0, 1, 0);
+ for (j = 0; j <= 1; j++)
+ {
+ glBegin (GL_LINE_STRIP);
+ glVertex3f (x[2], y[2], j*dc->frame_depth/2);
+ glVertex3f (x[3], y[2], j*dc->frame_depth/2);
+ glVertex3f (x[4], y[3], j*dc->frame_depth/2);
+ glVertex3f (x[5], y[2], j*dc->frame_depth/2);
+ glVertex3f (x[6], y[2], j*dc->frame_depth/2);
+ polys += 4;
+ glEnd ();
+ }
+ }
+
+ glTranslatef (0.5, 0.5, 0);
+ glRotatef (90, 0, 0, 1);
+ glTranslatef (-0.5, -0.5, 0);
+ }
+
+ glPopMatrix();
+ return polys;