+
+ENTRYPOINT void
+reshape_pipes(ModeInfo * mi, int width, int height)
+{
+ glViewport(0, 0, width, (GLint) height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ /*glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 15.0); */
+ gluPerspective(65.0, (GLfloat) width / (GLfloat) height, 0.1, 20.0);
+ glMatrixMode(GL_MODELVIEW);
+
+ glClear(GL_COLOR_BUFFER_BIT);
+}
+
+ENTRYPOINT Bool
+pipes_handle_event (ModeInfo *mi, XEvent *event)
+{
+ pipesstruct *pp = &pipes[MI_SCREEN(mi)];
+
+ if (event->xany.type == ButtonPress &&
+ event->xbutton.button == Button1)
+ {
+ pp->button_down_p = True;
+ gltrackball_start (pp->trackball,
+ event->xbutton.x, event->xbutton.y,
+ MI_WIDTH (mi), MI_HEIGHT (mi));
+ return True;
+ }
+ else if (event->xany.type == ButtonRelease &&
+ event->xbutton.button == Button1)
+ {
+ pp->button_down_p = False;
+ return True;
+ }
+ else if (event->xany.type == ButtonPress &&
+ (event->xbutton.button == Button4 ||
+ event->xbutton.button == Button5 ||
+ event->xbutton.button == Button6 ||
+ event->xbutton.button == Button7))
+ {
+ gltrackball_mousewheel (pp->trackball, event->xbutton.button, 10,
+ !!event->xbutton.state);
+ return True;
+ }
+ else if (event->xany.type == MotionNotify &&
+ pp->button_down_p)
+ {
+ gltrackball_track (pp->trackball,
+ event->xmotion.x, event->xmotion.y,
+ MI_WIDTH (mi), MI_HEIGHT (mi));
+ return True;
+ }
+
+ return False;
+}
+
+
+
+static void generate_system (ModeInfo *);
+
+
+ENTRYPOINT void
+init_pipes (ModeInfo * mi)