#ifdef STANDALONE
# define DEFAULTS "*delay: 25000 \n" \
"*showFPS: False \n" \
+ "*suppressRotationAnimation: True\n" \
# define refresh_hypertorus 0
# include "xlockmore.h" /* from the xscreensaver distribution */
#ifdef USE_GL
-#include <X11/keysym.h>
-
#include "gltrackball.h"
}
}
+#if 0 /* #### not working */
+# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */
+ {
+ GLfloat h = MI_HEIGHT(mi) / (GLfloat) MI_WIDTH(mi);
+ int o = (int) current_device_rotation();
+ if (o != 0 && o != 180 && o != -180)
+ glScalef (1/h, 1/h, 1/h);
+ }
+# endif
+#endif
+
skew = num_spirals;
ur = umax-umin;
vr = vmax-vmin;
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);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
}
- else
+ else /* display_mode == DISP_WIREFRAME */
{
glDisable(GL_DEPTH_TEST);
glShadeModel(GL_FLAT);
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)
}
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;
}
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;
hp = &hyper[MI_SCREEN(mi)];
- hp->trackballs[0] = gltrackball_init();
- hp->trackballs[1] = gltrackball_init();
+ hp->trackballs[0] = gltrackball_init(True);
+ hp->trackballs[1] = gltrackball_init(True);
hp->current_trackball = 0;
hp->button_pressed = False;