#define GLUT_FULL_SCREEN 0x01FF
+#define GLUT_SKIP_STALE_MOTION_EVENTS 0x0204
+
/*
* New tokens for glutInitDisplayMode.
* Only one GLUT_AUXn bit may be used at a time.
0, /* MouseWheelTicks */
1, /* AuxiliaryBufferNumber */
4, /* SampleNumber */
+ GL_FALSE, /* SkipStaleMotion */
1, /* OpenGL context MajorVersion */
0, /* OpenGL context MinorVersion */
0, /* OpenGL ContextFlags */
fgState.WarningFunc = vfgWarning;
}
-/*** END OF FILE ***/
\ No newline at end of file
+/*** END OF FILE ***/
int AuxiliaryBufferNumber; /* Number of auxiliary buffers */
int SampleNumber; /* Number of samples per pixel */
+ GLboolean SkipStaleMotion; /* skip stale motion events */
+
int MajorVersion; /* Major OpenGL context version */
int MinorVersion; /* Minor OpenGL context version */
int ContextFlags; /* OpenGL context flags */
fgState.SampleNumber = value;
break;
+ case GLUT_SKIP_STALE_MOTION_EVENTS:
+ fgState.SkipStaleMotion = value;
+ break;
+
default:
fgWarning( "glutSetOption(): missing enum handle %d", eWhat );
break;
case GLUT_MULTISAMPLE:
return fgState.SampleNumber;
+ case GLUT_SKIP_STALE_MOTION_EVENTS:
+ return fgState.SkipStaleMotion;
+
default:
return fgPlatformGlutGet ( eWhat );
break;
# define MIN(a,b) (((a)<(b)) ? (a) : (b))
#endif
+/* used in the event handling code to match and discard stale mouse motion events */
+static Bool match_motion(Display *dpy, XEvent *xev, XPointer arg);
+
/*
* TODO BEFORE THE STABLE RELEASE:
*
case MotionNotify:
{
+ /* if GLUT_SKIP_STALE_MOTION_EVENTS is true, then discard all but
+ * the last motion event from the queue
+ */
+ if(fgState.SkipStaleMotion) {
+ while(XCheckIfEvent(fgDisplay.pDisplay.Display, &event, match_motion, 0));
+ }
+
GETWINDOW( xmotion );
GETMOUSE( xmotion );
}
+static Bool match_motion(Display *dpy, XEvent *xev, XPointer arg)
+{
+ return xev->type == MotionNotify;
+}
+
void fgPlatformMainLoopPreliminaryWork ( void )
{
}