+#include <GL/gl.h>
+
+#define GAP_Y 1.0
+#define GAP_X 0.5
+#define WALL_WIDTH 0.2
+
+#define XOFFS_OUT (GAP_X + WALL_WIDTH)
+#define XOFFS_IN GAP_X
+#define YOFFS_OUT (GAP_Y + WALL_WIDTH)
+#define YOFFS_IN GAP_Y
+#define ZMAX 0.5
+
+enum {
+ COL_FRONT,
+ COL_LEFT,
+ COL_RIGHT,
+ COL_BOT,
+ NUM_COLORS
+};
+
+#define LLEFT 0.8
+#define LRIGHT 1.2
+#define LBOT 1.5
+
+static const float col[NUM_COLORS][3] = {
+ {0.75, 0.72, 0.8},
+ {0.75 * LLEFT, 0.72 * LLEFT, 0.8 * LLEFT},
+ {0.75 * LRIGHT, 0.72 * LRIGHT, 0.8 * LRIGHT},
+ {0.75 * LBOT, 0.72 * LBOT, 0.8 * LBOT}
+};
+
+void draw_shaft(void)
+{
+ glPushAttrib(GL_ENABLE_BIT);
+
+ glBegin(GL_QUADS);
+ /* tunnel-left */
+ glColor3fv(col[COL_LEFT]);
+ glVertex3f(-XOFFS_IN, -YOFFS_IN, 0);
+ glVertex3f(-XOFFS_IN, -YOFFS_IN, -ZMAX);
+ glVertex3f(-XOFFS_IN, YOFFS_OUT, -ZMAX);
+ glVertex3f(-XOFFS_IN, YOFFS_OUT, 0);
+
+ /* tunnel-bottom */
+ glColor3fv(col[COL_BOT]);
+ glVertex3f(-XOFFS_IN, -YOFFS_IN, 0);
+ glVertex3f(XOFFS_IN, -YOFFS_IN, 0);
+ glVertex3f(XOFFS_IN, -YOFFS_IN, -ZMAX);
+ glVertex3f(-XOFFS_IN, -YOFFS_IN, -ZMAX);
+
+ /* tunnel-right */
+ glColor3fv(col[COL_RIGHT]);
+ glVertex3f(XOFFS_IN, -YOFFS_IN, 0);
+ glVertex3f(XOFFS_IN, YOFFS_OUT, 0);
+ glVertex3f(XOFFS_IN, YOFFS_OUT, -ZMAX);
+ glVertex3f(XOFFS_IN, -YOFFS_IN, -ZMAX);
+
+ glColor3fv(col[COL_FRONT]);
+ /* left front face */
+ glVertex3f(-XOFFS_OUT, -YOFFS_OUT, 0);
+ glVertex3f(-XOFFS_IN, -YOFFS_IN, 0);
+ glVertex3f(-XOFFS_IN, YOFFS_OUT, 0);
+ glVertex3f(-XOFFS_OUT, YOFFS_OUT, 0);
+ /* bottom front face */
+ glVertex3f(-XOFFS_OUT, -YOFFS_OUT, 0);
+ glVertex3f(XOFFS_OUT, -YOFFS_OUT, 0);
+ glVertex3f(XOFFS_IN, -YOFFS_IN, 0);
+ glVertex3f(-XOFFS_IN, -YOFFS_IN, 0);
+ /* right front face */
+ glVertex3f(XOFFS_IN, -YOFFS_IN, 0);
+ glVertex3f(XOFFS_OUT, -YOFFS_OUT, 0);
+ glVertex3f(XOFFS_OUT, YOFFS_OUT, 0);
+ glVertex3f(XOFFS_IN, YOFFS_OUT, 0);
+
+ glEnd();
+
+ glPopAttrib();
+}