projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.21.tar.gz
[xscreensaver]
/
hacks
/
glx
/
hypertorus.c
diff --git
a/hacks/glx/hypertorus.c
b/hacks/glx/hypertorus.c
index a7d3ed950a77673a62de69bbdd29e910a3f8cd4c..908f612e266a8002114d52aeb95ee4420acf7ff7 100644
(file)
--- 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
#endif /* !STANDALONE */
#ifdef USE_GL
-
-#include <X11/keysym.h>
+#ifndef HAVE_COCOA
+# include <X11/keysym.h>
+#endif
#include "gltrackball.h"
#include "gltrackball.h"
@@
-630,16
+631,12
@@
static void init(ModeInfo *mi)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
+# ifdef HAVE_JWZGLES /* #### glPolygonMode other than GL_FILL unimplemented */
if (display_mode == DISP_WIREFRAME)
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);
{
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);
}
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
}
- else
+ else
/* display_mode == DISP_WIREFRAME */
{
glDisable(GL_DEPTH_TEST);
glShadeModel(GL_FLAT);
{
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)
{
ENTRYPOINT Bool hypertorus_handle_event(ModeInfo *mi, XEvent *event)
{
- Display *display = MI_DISPLAY(mi);
hypertorusstruct *hp = &hyper[MI_SCREEN(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)
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)
{
}
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;
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)
{
}
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;
if (sym == XK_Shift_L || sym == XK_Shift_R)
{
hp->current_trackball = 0;