# define VFPRINTF(s,f,a)
#endif
+#include "fg_main.h"
+
/*
* Try to get the maximum value allowed for ints, falling back to the minimum
* guaranteed by ISO C99 if there is no suitable header.
# 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:
*
/*
- * Handle a window configuration change. When no reshape
- * callback is hooked, the viewport size is updated to
- * match the new window size.
+ * Request a window resize
*/
void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height )
{
}
}
-static void fghPrintEvent( XEvent *event )
+__fg_unused static void fghPrintEvent( XEvent *event )
{
switch( event->type ) {
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 )
{
}