diff src/events/SDL_events.c @ 2674:f1d07ba2e275 gsoc2008_nds

Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
author Darren Alton <dalton@stevens.edu>
date Mon, 23 Jun 2008 11:55:26 +0000
parents 047245361002
children 3895761db26a
line wrap: on
line diff
--- a/src/events/SDL_events.c	Thu Jun 19 07:11:35 2008 +0000
+++ b/src/events/SDL_events.c	Mon Jun 23 11:55:26 2008 +0000
@@ -31,6 +31,9 @@
 #if !SDL_JOYSTICK_DISABLED
 #include "../joystick/SDL_joystick_c.h"
 #endif
+#if !SDL_TOUCHSCREEN_DISABLED
+#include "../touchscreen/SDL_touchscreen_c.h"
+#endif
 
 /* Public data -- the event filter */
 SDL_EventFilter SDL_EventOK = NULL;
@@ -117,6 +120,12 @@
             SDL_JoystickUpdate();
         }
 #endif
+#if !SDL_TOUCHSCREEN_DISABLED
+        /* Similarly, check for touchscreen state change */
+        if (SDL_numtouchscreens && (SDL_eventstate & SDL_TOUCHEVENTMASK)) {
+            SDL_TouchscreenUpdate();
+        }
+#endif
 
         /* Give up the CPU for the rest of our timeslice */
         SDL_EventLock.safe = 1;
@@ -388,6 +397,12 @@
             SDL_JoystickUpdate();
         }
 #endif
+#if !SDL_TOUCHSCREEN_DISABLED
+        /* Check for touchscreen state change */
+        if (SDL_numtouchscreens && (SDL_eventstate & SDL_TOUCHEVENTMASK)) {
+            SDL_TouchscreenUpdate();
+        }
+#endif
     }
 }