- switch(event->xany.type) {
- case ButtonPress:
-
- switch(event->xbutton.button) {
+ if (gltrackball_event_handler (event, mp->trackball,
+ MI_WIDTH (mi), MI_HEIGHT (mi),
+ &mp->button_down_p))
+ return True;
- case Button1:
- mp->button_down_p = True;
- gltrackball_start(mp->trackball,
- event->xbutton.x, event->xbutton.y,
- MI_WIDTH (mi), MI_HEIGHT (mi));
- break;
+ if (event->xany.type == ButtonPress)
+ {
+ switch(event->xbutton.button) {
- case Button4:
- mp->mag = max(mp->mag-1, 1);
- break;
-
- case Button5:
- mp->mag = min(mp->mag+1, MAX_MAGNIFICATION);
- break;
- }
-
- break;
-
- case ButtonRelease:
+ case Button4:
+ mp->mag = max(mp->mag-1, 1);
+ return True;
- break;
-
- case MotionNotify:
- if(mp->button_down_p)
- gltrackball_track(mp->trackball,
- event->xmotion.x, event->xmotion.y,
- MI_WIDTH (mi), MI_HEIGHT (mi));
- break;
-
- default:
- return False;
- }
-
- return True;
mp->mag = 4.0;
mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
mp->mag = 4.0;
mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
if ((mp->glx_context = init_GL(mi)) != NULL) {
reshape_antmaze(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
if ((mp->glx_context = init_GL(mi)) != NULL) {
reshape_antmaze(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
/* started ? -mag : -8.0 + 4.0*fabs(sin(ant_step/10.0)), */
/* started ? -mag : -8.0 + 4.0*fabs(sin(ant_step/10.0))); */
/* started ? -mag : -8.0 + 4.0*fabs(sin(ant_step/10.0)), */
/* started ? -mag : -8.0 + 4.0*fabs(sin(ant_step/10.0))); */
glRotatef(mp->ant_step*0.6, 0.0, 1.0, 0.0);
glRotatef(mp->ant_step*0.6, 0.0, 1.0, 0.0);
glTranslatef(0.0, 0.0, -16.0);
glRotatef(60.0, 1.0, 0.0, 0.0);
glRotatef(-15.0 + mp->ant_step/10.0, 0.0, 1.0, 0.0);
glTranslatef(0.0, 0.0, -16.0);
glRotatef(60.0, 1.0, 0.0, 0.0);
glRotatef(-15.0 + mp->ant_step/10.0, 0.0, 1.0, 0.0);