X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fextrusion.c;h=08786b29be7195f45c017eaa1ed7d0dbcfcf3459;hb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c;hp=ca5a18262fd423588d074320bb357387bf65f7dd;hpb=5f9c47ca98dd43d8f59b7c27d3fde6edfde4fe21;p=xscreensaver diff --git a/hacks/glx/extrusion.c b/hacks/glx/extrusion.c index ca5a1826..08786b29 100644 --- a/hacks/glx/extrusion.c +++ b/hacks/glx/extrusion.c @@ -218,11 +218,16 @@ static void Create_Texture(ModeInfo *mi, const char *filename) int format; if ( !strncmp(filename, "BUILTIN", 7)) - image = Generate_Image(&width, &height, &format); + { + BUILTIN: + image = Generate_Image(&width, &height, &format); + } else { XImage *ximage = xpm_file_to_ximage (MI_DISPLAY (mi), MI_VISUAL (mi), MI_COLORMAP (mi), filename); + if (!ximage) + goto BUILTIN; image = (GLubyte *) ximage->data; width = ximage->width; height = ximage->height; @@ -285,7 +290,7 @@ init_rotation (ModeInfo *mi) 0.2, 0.005, True); - gp->trackball = gltrackball_init (); + gp->trackball = gltrackball_init (True); lastx = (random() % (int) (max_lastx - min_lastx)) + min_lastx; lasty = (random() % (int) (max_lasty - min_lasty)) + min_lasty; @@ -442,6 +447,10 @@ initializeGL(ModeInfo *mi, GLsizei width, GLsizei height) glLightModeli (GL_LIGHT_MODEL_TWO_SIDE, True); glShadeModel(GL_SMOOTH); +# ifdef HAVE_JWZGLES /* #### glPolygonMode other than GL_FILL unimplemented */ + MI_IS_WIREFRAME(mi) = 0; +# endif + if (do_light) SetupLight(); if (MI_IS_WIREFRAME(mi)) { @@ -480,46 +489,34 @@ extrusion_handle_event (ModeInfo *mi, XEvent *event) event->xbutton.button == Button6 || event->xbutton.button == Button7)) { - gltrackball_mousewheel (gp->trackball, event->xbutton.button, 10, - !!event->xbutton.state); - return True; } else if (event->xany.type == ButtonPress && /* rotate with left button */ !event->xbutton.state) /* if no modifier keys */ { - gp->button_down_p = True; - gltrackball_start (gp->trackball, - event->xbutton.x, event->xbutton.y, - MI_WIDTH (mi), MI_HEIGHT (mi)); - return True; } else if (event->xany.type == ButtonPress) /* deform with other buttons */ { /* or with modifier keys */ gp->button2_down_p = True; - gp->mouse_start_x = gp->mouse_x = event->xbutton.x; - gp->mouse_start_y = gp->mouse_y = event->xbutton.y; - return True; } else if (event->xany.type == ButtonRelease) { gp->button_down_p = False; gp->button2_down_p = False; - return True; } else if (event->xany.type == MotionNotify) { - if (gp->button_down_p) - gltrackball_track (gp->trackball, - event->xmotion.x, event->xmotion.y, - MI_WIDTH (mi), MI_HEIGHT (mi)); if (gp->button2_down_p) { gp->mouse_x = event->xmotion.x; gp->mouse_y = event->xmotion.y; } - return True; } + if (gltrackball_event_handler (event, gp->trackball, + MI_WIDTH (mi), MI_HEIGHT (mi), + &gp->button_down_p)) + return True; + return False; }