X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fhypertorus.c;h=908f612e266a8002114d52aeb95ee4420acf7ff7;hb=ff35d056d723c9a5ffe728dbba5f1c25e141be04;hp=a7d3ed950a77673a62de69bbdd29e910a3f8cd4c;hpb=3243731044b944673630b55e16674c191b026f84;p=xscreensaver diff --git a/hacks/glx/hypertorus.c b/hacks/glx/hypertorus.c index a7d3ed95..908f612e 100644 --- a/hacks/glx/hypertorus.c +++ b/hacks/glx/hypertorus.c @@ -95,8 +95,9 @@ static const char sccsid[] = "@(#)hypertorus.c 1.2 05/09/28 xlockmore"; #endif /* !STANDALONE */ #ifdef USE_GL - -#include +#ifndef HAVE_COCOA +# include +#endif #include "gltrackball.h" @@ -630,16 +631,12 @@ static void init(ModeInfo *mi) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); +# ifdef HAVE_JWZGLES /* #### glPolygonMode other than GL_FILL unimplemented */ if (display_mode == DISP_WIREFRAME) - { - glDisable(GL_DEPTH_TEST); - glShadeModel(GL_FLAT); - glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); - glDisable(GL_LIGHTING); - glDisable(GL_LIGHT0); - glDisable(GL_BLEND); - } - else if (display_mode == DISP_SURFACE) + display_mode = DISP_SURFACE; +# endif + + if (display_mode == DISP_SURFACE) { glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); @@ -675,7 +672,7 @@ static void init(ModeInfo *mi) glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE); } - else + else /* display_mode == DISP_WIREFRAME */ { glDisable(GL_DEPTH_TEST); glShadeModel(GL_FLAT); @@ -747,9 +744,12 @@ ENTRYPOINT void reshape_hypertorus(ModeInfo *mi, int width, int height) ENTRYPOINT Bool hypertorus_handle_event(ModeInfo *mi, XEvent *event) { - Display *display = MI_DISPLAY(mi); hypertorusstruct *hp = &hyper[MI_SCREEN(mi)]; - KeySym sym; + KeySym sym = 0; + char c = 0; + + if (event->xany.type == KeyPress || event->xany.type == KeyRelease) + XLookupString (&event->xkey, &c, 1, &sym, 0); if (event->xany.type == ButtonPress && event->xbutton.button == Button1) @@ -768,7 +768,6 @@ ENTRYPOINT Bool hypertorus_handle_event(ModeInfo *mi, XEvent *event) } else if (event->xany.type == KeyPress) { - sym = XKeycodeToKeysym(display,event->xkey.keycode,0); if (sym == XK_Shift_L || sym == XK_Shift_R) { hp->current_trackball = 1; @@ -781,7 +780,6 @@ ENTRYPOINT Bool hypertorus_handle_event(ModeInfo *mi, XEvent *event) } else if (event->xany.type == KeyRelease) { - sym = XKeycodeToKeysym(display,event->xkey.keycode,0); if (sym == XK_Shift_L || sym == XK_Shift_R) { hp->current_trackball = 0;