Просмотр исходного кода

Merge branch 'next' of https://github.com/blackberry/GamePlay into next

Darryl Gough 13 лет назад
Родитель
Сommit
92e9b76749

+ 24 - 0
gameplay/gameplay.xcodeproj/project.pbxproj

@@ -32,6 +32,14 @@
 		4239DDEF157545A1005EA3F6 /* Joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = 4239DDEA157545A1005EA3F6 /* Joystick.h */; };
 		4239DDF4157545C1005EA3F6 /* MathUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 4239DDF1157545C1005EA3F6 /* MathUtil.h */; };
 		4239DDF5157545C1005EA3F6 /* MathUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 4239DDF1157545C1005EA3F6 /* MathUtil.h */; };
+		424CD6EF15F6F349009CA1B8 /* lua_Gesture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424CD6EB15F6F349009CA1B8 /* lua_Gesture.cpp */; };
+		424CD6F015F6F349009CA1B8 /* lua_Gesture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424CD6EB15F6F349009CA1B8 /* lua_Gesture.cpp */; };
+		424CD6F115F6F349009CA1B8 /* lua_Gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 424CD6EC15F6F349009CA1B8 /* lua_Gesture.h */; };
+		424CD6F215F6F349009CA1B8 /* lua_Gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 424CD6EC15F6F349009CA1B8 /* lua_Gesture.h */; };
+		424CD6F315F6F349009CA1B8 /* lua_GestureGestureEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424CD6ED15F6F349009CA1B8 /* lua_GestureGestureEvent.cpp */; };
+		424CD6F415F6F349009CA1B8 /* lua_GestureGestureEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 424CD6ED15F6F349009CA1B8 /* lua_GestureGestureEvent.cpp */; };
+		424CD6F515F6F349009CA1B8 /* lua_GestureGestureEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 424CD6EE15F6F349009CA1B8 /* lua_GestureGestureEvent.h */; };
+		424CD6F615F6F349009CA1B8 /* lua_GestureGestureEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 424CD6EE15F6F349009CA1B8 /* lua_GestureGestureEvent.h */; };
 		4251B131152D049B002F6199 /* ScreenDisplayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4251B12E152D049B002F6199 /* ScreenDisplayer.h */; };
 		4251B132152D049B002F6199 /* ScreenDisplayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4251B12E152D049B002F6199 /* ScreenDisplayer.h */; };
 		4251B133152D049B002F6199 /* ThemeStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4251B12F152D049B002F6199 /* ThemeStyle.cpp */; };
@@ -1708,6 +1716,10 @@
 		4239DDF1157545C1005EA3F6 /* MathUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MathUtil.h; path = src/MathUtil.h; sourceTree = SOURCE_ROOT; };
 		4239DDF2157545C1005EA3F6 /* MathUtil.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = MathUtil.inl; path = src/MathUtil.inl; sourceTree = SOURCE_ROOT; };
 		4239DDF3157545C1005EA3F6 /* MathUtilNeon.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = MathUtilNeon.inl; path = src/MathUtilNeon.inl; sourceTree = SOURCE_ROOT; };
+		424CD6EB15F6F349009CA1B8 /* lua_Gesture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_Gesture.cpp; sourceTree = "<group>"; };
+		424CD6EC15F6F349009CA1B8 /* lua_Gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_Gesture.h; sourceTree = "<group>"; };
+		424CD6ED15F6F349009CA1B8 /* lua_GestureGestureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_GestureGestureEvent.cpp; sourceTree = "<group>"; };
+		424CD6EE15F6F349009CA1B8 /* lua_GestureGestureEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_GestureGestureEvent.h; sourceTree = "<group>"; };
 		4251B12E152D049B002F6199 /* ScreenDisplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScreenDisplayer.h; path = src/ScreenDisplayer.h; sourceTree = SOURCE_ROOT; };
 		4251B12F152D049B002F6199 /* ThemeStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThemeStyle.cpp; path = src/ThemeStyle.cpp; sourceTree = SOURCE_ROOT; };
 		4251B130152D049B002F6199 /* ThemeStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThemeStyle.h; path = src/ThemeStyle.h; sourceTree = SOURCE_ROOT; };
@@ -3322,6 +3334,10 @@
 				42BCD38C15EFD0F300C0E076 /* lua_GamepadGamepadEvent.h */,
 				42BCD38D15EFD0F300C0E076 /* lua_GameState.cpp */,
 				42BCD38E15EFD0F300C0E076 /* lua_GameState.h */,
+				424CD6EB15F6F349009CA1B8 /* lua_Gesture.cpp */,
+				424CD6EC15F6F349009CA1B8 /* lua_Gesture.h */,
+				424CD6ED15F6F349009CA1B8 /* lua_GestureGestureEvent.cpp */,
+				424CD6EE15F6F349009CA1B8 /* lua_GestureGestureEvent.h */,
 				42BCD38F15EFD0F300C0E076 /* lua_Global.cpp */,
 				42BCD39015EFD0F300C0E076 /* lua_Global.h */,
 				42BCD39115EFD0F300C0E076 /* lua_Image.cpp */,
@@ -4016,6 +4032,8 @@
 				42BCD6C615EFD0F300C0E076 /* lua_VertexFormatElement.h in Headers */,
 				42BCD6CA15EFD0F300C0E076 /* lua_VertexFormatUsage.h in Headers */,
 				42BCD6CE15EFD0F300C0E076 /* lua_VerticalLayout.h in Headers */,
+				424CD6F115F6F349009CA1B8 /* lua_Gesture.h in Headers */,
+				424CD6F515F6F349009CA1B8 /* lua_GestureGestureEvent.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -4437,6 +4455,8 @@
 				42BCD6C715EFD0F300C0E076 /* lua_VertexFormatElement.h in Headers */,
 				42BCD6CB15EFD0F300C0E076 /* lua_VertexFormatUsage.h in Headers */,
 				42BCD6CF15EFD0F300C0E076 /* lua_VerticalLayout.h in Headers */,
+				424CD6F215F6F349009CA1B8 /* lua_Gesture.h in Headers */,
+				424CD6F615F6F349009CA1B8 /* lua_GestureGestureEvent.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -4918,6 +4938,8 @@
 				42BCD6CC15EFD0F300C0E076 /* lua_VerticalLayout.cpp in Sources */,
 				42BCD6D015EFD0F300C0E076 /* PlatformLinux.cpp in Sources */,
 				42BCD6D415EFD14800C0E076 /* gameplay-main-linux.cpp in Sources */,
+				424CD6EF15F6F349009CA1B8 /* lua_Gesture.cpp in Sources */,
+				424CD6F315F6F349009CA1B8 /* lua_GestureGestureEvent.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -5335,6 +5357,8 @@
 				42BCD6CD15EFD0F300C0E076 /* lua_VerticalLayout.cpp in Sources */,
 				42BCD6D115EFD0F300C0E076 /* PlatformLinux.cpp in Sources */,
 				42BCD6D515EFD14800C0E076 /* gameplay-main-linux.cpp in Sources */,
+				424CD6F015F6F349009CA1B8 /* lua_Gesture.cpp in Sources */,
+				424CD6F415F6F349009CA1B8 /* lua_GestureGestureEvent.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 1 - 0
gameplay/src/Base.h

@@ -24,6 +24,7 @@
 #include <algorithm>
 #include <limits>
 #include <functional>
+#include <bitset>
 
 // Bring common functions from C into global namespace
 using std::memcpy;

+ 9 - 7
gameplay/src/Game.cpp

@@ -441,28 +441,30 @@ bool Game::mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta)
     return false;
 }
 
-void Game::recognizeGesture(Gesture::GestureEvent evt)
+bool Game::isGestureSupported(Gesture::GestureEvent evt)
 {
-    Platform::recognizeGesture(evt);
+    return Platform::isGestureSupported(evt);
 }
 
-void Game::gestureSwipeEvent(int x, int y, int direction)
+void Game::registerGesture(Gesture::GestureEvent evt)
 {
+    Platform::registerGesture(evt);
 }
 
-void Game::gesturePinchEvent(int x, int y, float scale)
+void Game::unregisterGesture(Gesture::GestureEvent evt)
 {
+    Platform::unregisterGesture(evt);
 }
 
-void Game::gestureRotateEvent(int x, int y, float angle)
+void Game::gestureSwipeEvent(int x, int y, int direction)
 {
 }
 
-void Game::gestureTapEvent(int x, int y)
+void Game::gesturePinchEvent(int x, int y, float scale)
 {
 }
 
-void Game::gestureTapDoubleEvent(int x, int y)
+void Game::gestureTapEvent(int x, int y)
 {
 }
 

+ 26 - 27
gameplay/src/Game.h

@@ -361,24 +361,40 @@ public:
     inline bool isCursorVisible();
 
     /**
-     * Requests the game to recognize the specified gesture events.
+     * Determines whether a specific gesture event is supported.
      *
-     * This can be called multiple times to recognize more that one gesture.
-     * Call with Gesture::NONE to unrecognize all gestures. Once a gesture
-     * is recognized the specific gesture event methods will
+     * Use Gesture::GESTURE_ANY_SUPPORTED to test if one or more gesture events are supported.
+     *
+     * @param evt The gesture event to test and see if it is supported.
+     * @return true if the gesture tested is supported; false if not supported.
+     */
+    bool isGestureSupported(Gesture::GestureEvent evt);
+
+    /**
+     * Requests the game to register and start recognizing the specified gesture event.
+     *
+     * Call with Gesture::GESTURE_ANY_SUPPORTED to recognize all supported gestures.
+     * Once a gesture is recognized the specific gesture event methods will
      * begin to be called.
      *
      * Registering for:
      *
-     * Gesture::SWIPE calls gestureSwipeEvent(..)
-     * Gesture::PINCH calls gesturePinchEvent(..)
-     * Gesture::ROTATE calls gestureRotateEvent(..)
-     * Gesture::TAP calls gestureTapEvent(..)
-     * Gesture::TAP_DOUBLE calls gestureTapDoubleEvent(..)
+     * Gesture::GESTURE_SWIPE calls gestureSwipeEvent(..)
+     * Gesture::GESTURE_PINCH calls gesturePinchEvent(..)
+     * Gesture::GESTURE_TAP calls gestureTapEvent(..)
      *
      * @param evt The gesture event to start recognizing for
      */
-    void recognizeGesture(Gesture::GestureEvent evt);
+    void registerGesture(Gesture::GestureEvent evt);
+
+    /**
+     * Requests the game to unregister for and stop recognizing the specified gesture event.
+     *
+     * Call with Gesture::GESTURE_ANY_SUPPORTED to unregister events from all supported gestures.
+     *
+     * @param evt The gesture event to start recognizing for
+     */
+    void unregisterGesture(Gesture::GestureEvent evt);
 
     /**
      * Gesture callback on Gesture::SWIPE events.
@@ -403,15 +419,6 @@ public:
      */
     virtual void gesturePinchEvent(int x, int y, float scale);
 
-    /**
-     * Gesture callback on Gesture::ROTATE events.
-     *
-     * @param x The centroid x-coordinate of the rotate.
-     * @param y The centroid y-coordinate of the rotate.
-     * @param angle The angle of the rotation.
-     */
-    virtual void gestureRotateEvent(int x, int y, float angle);
-
     /**
      * Gesture callback on Gesture::TAP events.
      *
@@ -420,14 +427,6 @@ public:
      */
     virtual void gestureTapEvent(int x, int y);
 
-    /**
-     * Gesture callback on Gesture::TAP_DOUBLE events.
-     *
-     * @param x The x-coordinate of the double tap.
-     * @param y The y-coordinate of the double tap.
-     */
-    virtual void gestureTapDoubleEvent(int x, int y);
-
     /**
      * Gamepad callback on gamepad events. Override to receive Gamepad::CONNECTED_EVENT 
      * and Gamepad::DISCONNECTED_EVENT.

+ 2 - 4
gameplay/src/Gesture.h

@@ -16,12 +16,10 @@ public:
      */
     enum GestureEvent
     {
-        GESTURE_SWIPE   = 0,
+        GESTURE_SWIPE = 0,
         GESTURE_PINCH,
-        GESTURE_ROTATE,
         GESTURE_TAP,
-        GESTURE_TAP_DOUBLE,
-        GESTURE_NONE = -1
+        GESTURE_ANY_SUPPORTED = -1,
     };
 
     /**

+ 16 - 2
gameplay/src/Platform.h

@@ -186,12 +186,26 @@ public:
      */
     static void displayKeyboard(bool display);
 
+    /**
+     * Tests if the specified gesture is supported on the platform.
+     *
+     * @return true if it is supported; false if not supported.
+     */
+    static bool isGestureSupported(Gesture::GestureEvent evt);
+
+    /**
+     * Registers the platform for gesture recognition for the specified gesture event.
+     *
+     * @param evt The gesture event to register to start recognizing events for.
+     */
+    static void registerGesture(Gesture::GestureEvent evt);
+
     /**
      * Registers the platform for gesture recognition for the specified gesture event.
      *
-     * @param evt The gesture event to recognize or Gesture::NONE to disable gesture recognition events.
+     * @param evt The gesture event to register to start recognizing events for.
      */
-    static void recognizeGesture(Gesture::GestureEvent evt);
+    static void unregisterGesture(Gesture::GestureEvent evt);
 
     /** 
      * Gets the number of gamepad devices connected to the Platform.

+ 10 - 1
gameplay/src/PlatformAndroid.cpp

@@ -1012,7 +1012,16 @@ bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheel
     }
 }
 
-void Platform::recognizeGesture(Gesture::GestureEvent evt)
+bool Platform::isGestureSupported(Gesture::GestureEvent evt)
+{
+    return false;
+}
+
+void Platform::registerGesture(Gesture::GestureEvent evt)
+{
+}
+
+void Platform::unregisterGesture(Gesture::GestureEvent evt)
 {
 }
 

+ 10 - 2
gameplay/src/PlatformLinux.cpp

@@ -845,9 +845,17 @@ bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheel
     }
 }
 
-void Platform::recognizeGesture(Gesture::GestureEvent evt)
+bool Platform::isGestureSupported(Gesture::GestureEvent evt)
+{
+    return false;
+}
+
+void Platform::registerGesture(Gesture::GestureEvent evt)
+{
+}
+
+void Platform::unregisterGesture(Gesture::GestureEvent evt)
 {
-        // Do nothing
 }
 
 unsigned int Platform::getGamepadsConnected()

+ 10 - 2
gameplay/src/PlatformMacOSX.mm

@@ -879,9 +879,17 @@ bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheel
     }
 }
 
-void Platform::recognizeGesture(Gesture::GestureEvent evt)
+bool Platform::isGestureSupported(Gesture::GestureEvent evt)
+{
+    return false;
+}
+
+void Platform::registerGesture(Gesture::GestureEvent evt)
+{
+}
+
+void Platform::unregisterGesture(Gesture::GestureEvent evt)
 {
-    // Do nothing
 }
 
 unsigned int Platform::getGamepadsConnected()

+ 41 - 55
gameplay/src/PlatformQNX.cpp

@@ -13,9 +13,7 @@
 #include <gestures/set.h>
 #include <gestures/swipe.h>
 #include <gestures/pinch.h>
-#include <gestures/rotate.h>
 #include <gestures/tap.h>
-#include <gestures/double_tap.h>
 #include <bps/bps.h>
 #include <bps/event.h>
 #include <bps/screen.h>
@@ -46,8 +44,7 @@ static float __pitch;
 static float __roll;
 static const char* __glExtensions;
 static struct gestures_set * __gestureSet;
-static bool __gestureEventsProcessed;
-static bool __gestureEvents[5];
+static bitset<3> __gestureEventsProcessed;
 PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray = NULL;
 PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays = NULL;
 PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays = NULL;
@@ -450,17 +447,17 @@ void gesture_callback(gesture_base_t* gesture, mtouch_event_t* event, void* para
     {
     case GESTURE_SWIPE:
         {
-            if (__gestureEvents[(unsigned int) Gesture::GESTURE_SWIPE])
+            if ( __gestureEventsProcessed.test(Gesture::GESTURE_SWIPE) )
             {
                 gesture_swipe_t* swipe = (gesture_swipe_t*)gesture;
                 Game::getInstance()->gestureSwipeEvent(swipe->coords.x, swipe->coords.y, swipe->direction);
             }
+            break;
         }
-        break;
 
     case GESTURE_PINCH:
         {
-            if (__gestureEvents[(unsigned int) Gesture::GESTURE_PINCH])
+            if ( __gestureEventsProcessed.test(Gesture::GESTURE_PINCH) )
             {
                 gesture_pinch_t* pinch = (gesture_pinch_t*)gesture;
                 float dist_x = (float)pinch->last_distance.x - (float)pinch->distance.x;
@@ -468,38 +465,22 @@ void gesture_callback(gesture_base_t* gesture, mtouch_event_t* event, void* para
                 float scale = sqrt( (dist_x * dist_x) + (dist_y * dist_y) );
                 Game::getInstance()->gesturePinchEvent(pinch->centroid.x, pinch->centroid.y, scale);
             }
+            break;
         }
-        break;
-
-    case GESTURE_ROTATE:
-        {
-            if (__gestureEvents[(unsigned int) Gesture::GESTURE_ROTATE])
-            {
-                gesture_rotate_t* rotate = (gesture_rotate_t*)gesture;
-                Game::getInstance()->gestureRotateEvent(rotate->centroid.x, rotate->centroid.y, rotate->angle);
-            }
-        }
-        break;
 
     case GESTURE_TAP:
         {
-            if (__gestureEvents[(unsigned int) Gesture::GESTURE_TAP])
+            if ( __gestureEventsProcessed.test(Gesture::GESTURE_TAP) )
             {
                 gesture_tap_t* tap = (gesture_tap_t*)gesture;
                 Game::getInstance()->gestureTapEvent(tap->touch_coords.x, tap->touch_coords.y);
             }
+            break;
         }
-        break;
 
-    case GESTURE_DOUBLE_TAP:
-        {
-            if (__gestureEvents[(unsigned int) Gesture::GESTURE_TAP_DOUBLE])
-            {
-                gesture_tap_t* double_tap = (gesture_tap_t*)gesture;
-                Game::getInstance()->gestureTapDoubleEvent(double_tap->touch_coords.x, double_tap->touch_coords.y);
-            }
-        }
+    default:
         break;
+
     }
 }
 
@@ -560,9 +541,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
     __gestureSet = gestures_set_alloc();
     swipe_gesture_alloc(NULL, gesture_callback, __gestureSet);
     pinch_gesture_alloc(NULL, gesture_callback, __gestureSet);
-    rotate_gesture_alloc(NULL, gesture_callback, __gestureSet);
     tap_gesture_alloc(NULL, gesture_callback, __gestureSet);
-    double_tap_gesture_alloc(NULL, gesture_callback, __gestureSet);
 
     bps_initialize();
 
@@ -824,7 +803,6 @@ Platform* Platform::create(Game* game, void* attachToWindow)
 error:
 
     // TODO: cleanup
-    //
 
     return NULL;
 }
@@ -899,10 +877,10 @@ int Platform::enterMessagePump()
                     case SCREEN_EVENT_MTOUCH_TOUCH:
                     {
                         screen_get_mtouch_event(__screenEvent, &touchEvent, 0);
-                        if (__gestureEventsProcessed)
+                        if (__gestureEventsProcessed.any())
                             rc = gestures_set_process_event(__gestureSet, &touchEvent, NULL);
 
-                        if ( !rc && (__multiTouch || touchEvent.contact_id == 0))
+                        if ( !rc && (__multiTouch || touchEvent.contact_id == 0) )
                         {
                             gameplay::Platform::touchEventInternal(Touch::TOUCH_PRESS, touchEvent.x, touchEvent.y, touchEvent.contact_id);
                         }
@@ -912,10 +890,10 @@ int Platform::enterMessagePump()
                     case SCREEN_EVENT_MTOUCH_RELEASE:
                     {
                         screen_get_mtouch_event(__screenEvent, &touchEvent, 0);
-                        if (__gestureEventsProcessed)
+                        if (__gestureEventsProcessed.any())
                             rc = gestures_set_process_event(__gestureSet, &touchEvent, NULL);
 
-                        if (!rc && (__multiTouch || touchEvent.contact_id == 0))
+                        if ( !rc && (__multiTouch || touchEvent.contact_id == 0) )
                         {
                             gameplay::Platform::touchEventInternal(Touch::TOUCH_RELEASE, touchEvent.x, touchEvent.y, touchEvent.contact_id);
                         }
@@ -925,10 +903,10 @@ int Platform::enterMessagePump()
                     case SCREEN_EVENT_MTOUCH_MOVE:
                     {
                         screen_get_mtouch_event(__screenEvent, &touchEvent, 0);
-                        if (__gestureEventsProcessed)
+                        if (__gestureEventsProcessed.any())
                             rc = gestures_set_process_event(__gestureSet, &touchEvent, NULL);
 
-                        if (!rc && (__multiTouch || touchEvent.contact_id == 0))
+                        if ( !rc && (__multiTouch || touchEvent.contact_id == 0) )
                         {
                             gameplay::Platform::touchEventInternal(Touch::TOUCH_MOVE, touchEvent.x, touchEvent.y, touchEvent.contact_id);
                         }
@@ -1290,38 +1268,46 @@ bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheel
     }
 }
 
-void Platform::recognizeGesture(Gesture::GestureEvent evt)
+bool Platform::isGestureSupported(Gesture::GestureEvent evt)
+{
+    // All are supported no need to test th bitset
+    return true;
+}
+
+void Platform::registerGesture(Gesture::GestureEvent evt)
 {
     switch(evt)
     {
-    case Gesture::GESTURE_NONE:
-        __gestureEventsProcessed = false;
-        memset( __gestureEvents, 0, sizeof(__gestureEvents));
+    case Gesture::GESTURE_ANY_SUPPORTED:
+        __gestureEventsProcessed.set();
         break;
 
     case Gesture::GESTURE_SWIPE:
-        __gestureEventsProcessed = true;
-        __gestureEvents[(unsigned int) Gesture::GESTURE_SWIPE] = true;
+    case Gesture::GESTURE_PINCH:
+    case Gesture::GESTURE_TAP:
+        __gestureEventsProcessed.set(evt);
         break;
 
-    case Gesture::GESTURE_PINCH:
-        __gestureEventsProcessed = true;
-        __gestureEvents[(unsigned int) Gesture::GESTURE_PINCH] = true;
-            break;
+    default:
+        break;
+    }
+}
 
-    case Gesture::GESTURE_ROTATE:
-        __gestureEventsProcessed = true;
-        __gestureEvents[(unsigned int) Gesture::GESTURE_ROTATE] = true;
+void Platform::unregisterGesture(Gesture::GestureEvent evt)
+{
+    switch(evt)
+    {
+    case Gesture::GESTURE_ANY_SUPPORTED:
+        __gestureEventsProcessed.reset();
         break;
 
+    case Gesture::GESTURE_SWIPE:
+    case Gesture::GESTURE_PINCH:
     case Gesture::GESTURE_TAP:
-        __gestureEventsProcessed = true;
-        __gestureEvents[(unsigned int) Gesture::GESTURE_TAP] = true;
+        __gestureEventsProcessed.set(evt, 0);
         break;
 
-    case Gesture::GESTURE_TAP_DOUBLE:
-        __gestureEventsProcessed = true;
-        __gestureEvents[(unsigned int) Gesture::GESTURE_TAP_DOUBLE] = true;
+    default:
         break;
     }
 }

+ 10 - 2
gameplay/src/PlatformWin32.cpp

@@ -1023,9 +1023,17 @@ void Platform::displayKeyboard(bool display)
     // Do nothing.
 }
 
-void Platform::recognizeGesture(Gesture::GestureEvent evt)
+bool Platform::isGestureSupported(Gesture::GestureEvent evt)
+{
+    return false;
+}
+
+void Platform::registerGesture(Gesture::GestureEvent evt)
+{
+}
+
+void Platform::unregisterGesture(Gesture::GestureEvent evt)
 {
-    // Do nothing
 }
 
 unsigned int Platform::getGamepadsConnected()

+ 11 - 2
gameplay/src/PlatformiOS.mm

@@ -988,8 +988,17 @@ bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheel
     }
 }    
 
-void Platform::recognizeGesture(Gesture::GestureEvent evt)
-{
+bool Platform::isGestureSupported(Gesture::GestureEvent evt)
+{
+    return false;
+}
+
+void Platform::registerGesture(Gesture::GestureEvent evt)
+{
+}
+
+void Platform::unregisterGesture(Gesture::GestureEvent evt)
+{
 }
 
 unsigned int Platform::getGamepadsConnected()

+ 3 - 2
gameplay/src/Texture.cpp

@@ -159,6 +159,7 @@ Texture* Texture::create(Format format, unsigned int width, unsigned int height,
     GLuint textureId;
     GL_ASSERT( glGenTextures(1, &textureId) );
     GL_ASSERT( glBindTexture(GL_TEXTURE_2D, textureId) );
+    GL_ASSERT( glPixelStorei(GL_UNPACK_ALIGNMENT, 1) );
     GL_ASSERT( glTexImage2D(GL_TEXTURE_2D, 0, (GLenum)format, width, height, 0, (GLenum)format, GL_UNSIGNED_BYTE, data) );
 
 
@@ -723,13 +724,13 @@ Texture* Texture::createCompressedDDS(const char* path)
         }
         else
         {
+            // TODO: For uncompressed formats, set GL_UNPACK_ALIGNMENT based on stride
             GL_ASSERT( glTexImage2D(GL_TEXTURE_2D, i, internalFormat, mipLevels[i].width, mipLevels[i].height, 0, format, GL_UNSIGNED_INT, mipLevels[i].data) );
         }
-        
+
         // Clean up the texture data.
         SAFE_DELETE_ARRAY(mipLevels[i].data);
     }
-    
 
     // Clean up mip levels structure.
     SAFE_DELETE_ARRAY(mipLevels);

+ 15 - 0
gameplay/src/Texture.h

@@ -152,12 +152,27 @@ public:
 
     /**
      * Creates a texture from the given image.
+     *
+     * @param image The image containing the texture data.
+     * @param generateMipmaps True to generate a full mipmap chain, false otherwise.
+     *
+     * @return The new texture, or NULL if the image is not of a supported texture format.
      * @script{create}
      */
     static Texture* create(Image* image, bool generateMipmaps = false);
 
     /**
      * Creates a texture from the given texture data.
+     *
+     * The data in the texture is expected to be tightly packed (no padding at the end of rows).
+     *
+     * @param format Format of the texture data.
+     * @param width Width of the texture data.
+     * @param height Height of the texture data.
+     * @param data Raw texture data (expected to be tightly packed).
+     * @param generateMipmaps True to generate a full mipmap chain, false otherwise.
+     *
+     * @return The new texture.
      * @script{create}
      */
     static Texture* create(Format format, unsigned int width, unsigned int height, unsigned char* data, bool generateMipmaps = false);

+ 85 - 94
gameplay/src/lua/lua_Game.cpp

@@ -29,9 +29,7 @@ void luaRegister_Game()
         {"frame", lua_Game_frame},
         {"gamepadEvent", lua_Game_gamepadEvent},
         {"gesturePinchEvent", lua_Game_gesturePinchEvent},
-        {"gestureRotateEvent", lua_Game_gestureRotateEvent},
         {"gestureSwipeEvent", lua_Game_gestureSwipeEvent},
-        {"gestureTapDoubleEvent", lua_Game_gestureTapDoubleEvent},
         {"gestureTapEvent", lua_Game_gestureTapEvent},
         {"getAIController", lua_Game_getAIController},
         {"getAccelerometerValues", lua_Game_getAccelerometerValues},
@@ -52,6 +50,7 @@ void luaRegister_Game()
         {"getWidth", lua_Game_getWidth},
         {"hasMouse", lua_Game_hasMouse},
         {"isCursorVisible", lua_Game_isCursorVisible},
+        {"isGestureSupported", lua_Game_isGestureSupported},
         {"isInitialized", lua_Game_isInitialized},
         {"isMouseCaptured", lua_Game_isMouseCaptured},
         {"isMultiTouch", lua_Game_isMultiTouch},
@@ -59,7 +58,7 @@ void luaRegister_Game()
         {"menuEvent", lua_Game_menuEvent},
         {"mouseEvent", lua_Game_mouseEvent},
         {"pause", lua_Game_pause},
-        {"recognizeGesture", lua_Game_recognizeGesture},
+        {"registerGesture", lua_Game_registerGesture},
         {"resume", lua_Game_resume},
         {"run", lua_Game_run},
         {"schedule", lua_Game_schedule},
@@ -68,6 +67,7 @@ void luaRegister_Game()
         {"setMultiTouch", lua_Game_setMultiTouch},
         {"setViewport", lua_Game_setViewport},
         {"touchEvent", lua_Game_touchEvent},
+        {"unregisterGesture", lua_Game_unregisterGesture},
         {NULL, NULL}
     };
     const luaL_Reg lua_statics[] = 
@@ -419,52 +419,6 @@ int lua_Game_gesturePinchEvent(lua_State* state)
     return 0;
 }
 
-int lua_Game_gestureRotateEvent(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 4:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TNUMBER &&
-                lua_type(state, 3) == LUA_TNUMBER &&
-                lua_type(state, 4) == LUA_TNUMBER)
-            {
-                // Get parameter 1 off the stack.
-                int param1 = (int)luaL_checkint(state, 2);
-
-                // Get parameter 2 off the stack.
-                int param2 = (int)luaL_checkint(state, 3);
-
-                // Get parameter 3 off the stack.
-                float param3 = (float)luaL_checknumber(state, 4);
-
-                Game* instance = getInstance(state);
-                instance->gestureRotateEvent(param1, param2, param3);
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Game_gestureRotateEvent - Failed to match the given parameters to a valid function signature.");
-                lua_error(state);
-            }
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 4).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Game_gestureSwipeEvent(lua_State* state)
 {
     // Get the number of parameters.
@@ -511,48 +465,6 @@ int lua_Game_gestureSwipeEvent(lua_State* state)
     return 0;
 }
 
-int lua_Game_gestureTapDoubleEvent(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 3:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TNUMBER &&
-                lua_type(state, 3) == LUA_TNUMBER)
-            {
-                // Get parameter 1 off the stack.
-                int param1 = (int)luaL_checkint(state, 2);
-
-                // Get parameter 2 off the stack.
-                int param2 = (int)luaL_checkint(state, 3);
-
-                Game* instance = getInstance(state);
-                instance->gestureTapDoubleEvent(param1, param2);
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Game_gestureTapDoubleEvent - Failed to match the given parameters to a valid function signature.");
-                lua_error(state);
-            }
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Game_gestureTapEvent(lua_State* state)
 {
     // Get the number of parameters.
@@ -1388,6 +1300,47 @@ int lua_Game_isCursorVisible(lua_State* state)
     return 0;
 }
 
+int lua_Game_isGestureSupported(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 2));
+
+                Game* instance = getInstance(state);
+                bool result = instance->isGestureSupported(param1);
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Game_isGestureSupported - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Game_isInitialized(lua_State* state)
 {
     // Get the number of parameters.
@@ -1662,7 +1615,7 @@ int lua_Game_pause(lua_State* state)
     return 0;
 }
 
-int lua_Game_recognizeGesture(lua_State* state)
+int lua_Game_registerGesture(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -1679,13 +1632,13 @@ int lua_Game_recognizeGesture(lua_State* state)
                 Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 2));
 
                 Game* instance = getInstance(state);
-                instance->recognizeGesture(param1);
+                instance->registerGesture(param1);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Game_recognizeGesture - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Game_registerGesture - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -2172,4 +2125,42 @@ int lua_Game_touchEvent(lua_State* state)
     return 0;
 }
 
+int lua_Game_unregisterGesture(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 2));
+
+                Game* instance = getInstance(state);
+                instance->unregisterGesture(param1);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Game_unregisterGesture - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 }

+ 3 - 3
gameplay/src/lua/lua_Game.h

@@ -12,9 +12,7 @@ int lua_Game_exit(lua_State* state);
 int lua_Game_frame(lua_State* state);
 int lua_Game_gamepadEvent(lua_State* state);
 int lua_Game_gesturePinchEvent(lua_State* state);
-int lua_Game_gestureRotateEvent(lua_State* state);
 int lua_Game_gestureSwipeEvent(lua_State* state);
-int lua_Game_gestureTapDoubleEvent(lua_State* state);
 int lua_Game_gestureTapEvent(lua_State* state);
 int lua_Game_getAIController(lua_State* state);
 int lua_Game_getAccelerometerValues(lua_State* state);
@@ -35,6 +33,7 @@ int lua_Game_getViewport(lua_State* state);
 int lua_Game_getWidth(lua_State* state);
 int lua_Game_hasMouse(lua_State* state);
 int lua_Game_isCursorVisible(lua_State* state);
+int lua_Game_isGestureSupported(lua_State* state);
 int lua_Game_isInitialized(lua_State* state);
 int lua_Game_isMouseCaptured(lua_State* state);
 int lua_Game_isMultiTouch(lua_State* state);
@@ -42,7 +41,7 @@ int lua_Game_keyEvent(lua_State* state);
 int lua_Game_menuEvent(lua_State* state);
 int lua_Game_mouseEvent(lua_State* state);
 int lua_Game_pause(lua_State* state);
-int lua_Game_recognizeGesture(lua_State* state);
+int lua_Game_registerGesture(lua_State* state);
 int lua_Game_resume(lua_State* state);
 int lua_Game_run(lua_State* state);
 int lua_Game_schedule(lua_State* state);
@@ -56,6 +55,7 @@ int lua_Game_static_getInstance(lua_State* state);
 int lua_Game_static_isVsync(lua_State* state);
 int lua_Game_static_setVsync(lua_State* state);
 int lua_Game_touchEvent(lua_State* state);
+int lua_Game_unregisterGesture(lua_State* state);
 
 void luaRegister_Game();
 

+ 5 - 15
gameplay/src/lua/lua_GestureGestureEvent.cpp

@@ -8,10 +8,8 @@ static const char* enumStringEmpty = "";
 
 static const char* luaEnumString_GestureGestureEvent_GESTURE_SWIPE = "GESTURE_SWIPE";
 static const char* luaEnumString_GestureGestureEvent_GESTURE_PINCH = "GESTURE_PINCH";
-static const char* luaEnumString_GestureGestureEvent_GESTURE_ROTATE = "GESTURE_ROTATE";
 static const char* luaEnumString_GestureGestureEvent_GESTURE_TAP = "GESTURE_TAP";
-static const char* luaEnumString_GestureGestureEvent_GESTURE_TAP_DOUBLE = "GESTURE_TAP_DOUBLE";
-static const char* luaEnumString_GestureGestureEvent_GESTURE_NONE = "GESTURE_NONE";
+static const char* luaEnumString_GestureGestureEvent_GESTURE_ANY_SUPPORTED = "GESTURE_ANY_SUPPORTED";
 
 Gesture::GestureEvent lua_enumFromString_GestureGestureEvent(const char* s)
 {
@@ -19,14 +17,10 @@ Gesture::GestureEvent lua_enumFromString_GestureGestureEvent(const char* s)
         return Gesture::GESTURE_SWIPE;
     if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_PINCH) == 0)
         return Gesture::GESTURE_PINCH;
-    if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_ROTATE) == 0)
-        return Gesture::GESTURE_ROTATE;
     if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_TAP) == 0)
         return Gesture::GESTURE_TAP;
-    if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_TAP_DOUBLE) == 0)
-        return Gesture::GESTURE_TAP_DOUBLE;
-    if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_NONE) == 0)
-        return Gesture::GESTURE_NONE;
+    if (strcmp(s, luaEnumString_GestureGestureEvent_GESTURE_ANY_SUPPORTED) == 0)
+        return Gesture::GESTURE_ANY_SUPPORTED;
     GP_ERROR("Invalid enumeration value '%s' for enumeration Gesture::GestureEvent.", s);
     return Gesture::GESTURE_SWIPE;
 }
@@ -37,14 +31,10 @@ const char* lua_stringFromEnum_GestureGestureEvent(Gesture::GestureEvent e)
         return luaEnumString_GestureGestureEvent_GESTURE_SWIPE;
     if (e == Gesture::GESTURE_PINCH)
         return luaEnumString_GestureGestureEvent_GESTURE_PINCH;
-    if (e == Gesture::GESTURE_ROTATE)
-        return luaEnumString_GestureGestureEvent_GESTURE_ROTATE;
     if (e == Gesture::GESTURE_TAP)
         return luaEnumString_GestureGestureEvent_GESTURE_TAP;
-    if (e == Gesture::GESTURE_TAP_DOUBLE)
-        return luaEnumString_GestureGestureEvent_GESTURE_TAP_DOUBLE;
-    if (e == Gesture::GESTURE_NONE)
-        return luaEnumString_GestureGestureEvent_GESTURE_NONE;
+    if (e == Gesture::GESTURE_ANY_SUPPORTED)
+        return luaEnumString_GestureGestureEvent_GESTURE_ANY_SUPPORTED;
     GP_ERROR("Invalid enumeration value '%d' for enumeration Gesture::GestureEvent.", e);
     return enumStringEmpty;
 }

+ 1 - 3
gameplay/src/lua/lua_Global.cpp

@@ -362,10 +362,8 @@ void luaRegister_lua_Global()
         scopePath.push_back("Gesture");
         ScriptUtil::registerConstantString("GESTURE_SWIPE", "GESTURE_SWIPE", scopePath);
         ScriptUtil::registerConstantString("GESTURE_PINCH", "GESTURE_PINCH", scopePath);
-        ScriptUtil::registerConstantString("GESTURE_ROTATE", "GESTURE_ROTATE", scopePath);
         ScriptUtil::registerConstantString("GESTURE_TAP", "GESTURE_TAP", scopePath);
-        ScriptUtil::registerConstantString("GESTURE_TAP_DOUBLE", "GESTURE_TAP_DOUBLE", scopePath);
-        ScriptUtil::registerConstantString("GESTURE_NONE", "GESTURE_NONE", scopePath);
+        ScriptUtil::registerConstantString("GESTURE_ANY_SUPPORTED", "GESTURE_ANY_SUPPORTED", scopePath);
     }
 
     // Register enumeration Image::Format.

+ 81 - 4
gameplay/src/lua/lua_Platform.cpp

@@ -38,12 +38,13 @@ void luaRegister_Platform()
         {"isCursorVisible", lua_Platform_static_isCursorVisible},
         {"isGamepadConnected", lua_Platform_static_isGamepadConnected},
         {"isGamepadJoystickActive", lua_Platform_static_isGamepadJoystickActive},
+        {"isGestureSupported", lua_Platform_static_isGestureSupported},
         {"isMouseCaptured", lua_Platform_static_isMouseCaptured},
         {"isMultiTouch", lua_Platform_static_isMultiTouch},
         {"isVsync", lua_Platform_static_isVsync},
         {"keyEventInternal", lua_Platform_static_keyEventInternal},
         {"mouseEventInternal", lua_Platform_static_mouseEventInternal},
-        {"recognizeGesture", lua_Platform_static_recognizeGesture},
+        {"registerGesture", lua_Platform_static_registerGesture},
         {"setAbsoluteTime", lua_Platform_static_setAbsoluteTime},
         {"setCursorVisible", lua_Platform_static_setCursorVisible},
         {"setMouseCaptured", lua_Platform_static_setMouseCaptured},
@@ -53,6 +54,7 @@ void luaRegister_Platform()
         {"sleep", lua_Platform_static_sleep},
         {"swapBuffers", lua_Platform_static_swapBuffers},
         {"touchEventInternal", lua_Platform_static_touchEventInternal},
+        {"unregisterGesture", lua_Platform_static_unregisterGesture},
         {NULL, NULL}
     };
     std::vector<std::string> scopePath;
@@ -842,6 +844,45 @@ int lua_Platform_static_isGamepadJoystickActive(lua_State* state)
     return 0;
 }
 
+int lua_Platform_static_isGestureSupported(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 1));
+
+                bool result = Platform::isGestureSupported(param1);
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Platform_static_isGestureSupported - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Platform_static_isMouseCaptured(lua_State* state)
 {
     // Get the number of parameters.
@@ -1017,7 +1058,7 @@ int lua_Platform_static_mouseEventInternal(lua_State* state)
     return 0;
 }
 
-int lua_Platform_static_recognizeGesture(lua_State* state)
+int lua_Platform_static_registerGesture(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -1032,13 +1073,13 @@ int lua_Platform_static_recognizeGesture(lua_State* state)
                 // Get parameter 1 off the stack.
                 Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 1));
 
-                Platform::recognizeGesture(param1);
+                Platform::registerGesture(param1);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Platform_static_recognizeGesture - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Platform_static_registerGesture - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -1367,4 +1408,40 @@ int lua_Platform_static_touchEventInternal(lua_State* state)
     return 0;
 }
 
+int lua_Platform_static_unregisterGesture(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                Gesture::GestureEvent param1 = (Gesture::GestureEvent)lua_enumFromString_GestureGestureEvent(luaL_checkstring(state, 1));
+
+                Platform::unregisterGesture(param1);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Platform_static_unregisterGesture - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 }

+ 3 - 1
gameplay/src/lua/lua_Platform.h

@@ -26,12 +26,13 @@ int lua_Platform_static_hasMouse(lua_State* state);
 int lua_Platform_static_isCursorVisible(lua_State* state);
 int lua_Platform_static_isGamepadConnected(lua_State* state);
 int lua_Platform_static_isGamepadJoystickActive(lua_State* state);
+int lua_Platform_static_isGestureSupported(lua_State* state);
 int lua_Platform_static_isMouseCaptured(lua_State* state);
 int lua_Platform_static_isMultiTouch(lua_State* state);
 int lua_Platform_static_isVsync(lua_State* state);
 int lua_Platform_static_keyEventInternal(lua_State* state);
 int lua_Platform_static_mouseEventInternal(lua_State* state);
-int lua_Platform_static_recognizeGesture(lua_State* state);
+int lua_Platform_static_registerGesture(lua_State* state);
 int lua_Platform_static_setAbsoluteTime(lua_State* state);
 int lua_Platform_static_setCursorVisible(lua_State* state);
 int lua_Platform_static_setMouseCaptured(lua_State* state);
@@ -41,6 +42,7 @@ int lua_Platform_static_signalShutdown(lua_State* state);
 int lua_Platform_static_sleep(lua_State* state);
 int lua_Platform_static_swapBuffers(lua_State* state);
 int lua_Platform_static_touchEventInternal(lua_State* state);
+int lua_Platform_static_unregisterGesture(lua_State* state);
 
 void luaRegister_Platform();