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

Added lua generated files for Gesture support.
Updated the template project for Momentics projects to include gestures library.
Added the gesture files to the android build.

setaylor 13 лет назад
Родитель
Сommit
7e3cebc40e

+ 7 - 0
gameplay-template/template.cproject

@@ -67,6 +67,7 @@
 									<listOptionValue builtIn="false" value="png14"/>
 									<listOptionValue builtIn="false" value="pps"/>
 									<listOptionValue builtIn="false" value="bps"/>
+									<listOptionValue builtIn="false" value="gestures"/>
 									<listOptionValue builtIn="false" value="OpenAL"/>
 									<listOptionValue builtIn="false" value="asound"/>
 									<listOptionValue builtIn="false" value="gameplay"/>
@@ -151,6 +152,7 @@
 									<listOptionValue builtIn="false" value="png14"/>
 									<listOptionValue builtIn="false" value="pps"/>
 									<listOptionValue builtIn="false" value="bps"/>
+									<listOptionValue builtIn="false" value="gestures"/>
 									<listOptionValue builtIn="false" value="OpenAL"/>
 									<listOptionValue builtIn="false" value="asound"/>
 									<listOptionValue builtIn="false" value="gameplay"/>
@@ -238,6 +240,7 @@
 									<listOptionValue builtIn="false" value="png14"/>
 									<listOptionValue builtIn="false" value="pps"/>
 									<listOptionValue builtIn="false" value="bps"/>
+									<listOptionValue builtIn="false" value="gestures"/>
 									<listOptionValue builtIn="false" value="OpenAL"/>
 									<listOptionValue builtIn="false" value="asound"/>
 									<listOptionValue builtIn="false" value="gameplay"/>
@@ -326,6 +329,7 @@
 									<listOptionValue builtIn="false" value="png14"/>
 									<listOptionValue builtIn="false" value="pps"/>
 									<listOptionValue builtIn="false" value="bps"/>
+									<listOptionValue builtIn="false" value="gestures"/>
 									<listOptionValue builtIn="false" value="OpenAL"/>
 									<listOptionValue builtIn="false" value="asound"/>
 									<listOptionValue builtIn="false" value="gameplay"/>
@@ -411,6 +415,7 @@
 									<listOptionValue builtIn="false" value="png14"/>
 									<listOptionValue builtIn="false" value="pps"/>
 									<listOptionValue builtIn="false" value="bps"/>
+									<listOptionValue builtIn="false" value="gestures"/>
 									<listOptionValue builtIn="false" value="OpenAL"/>
 									<listOptionValue builtIn="false" value="asound"/>
 									<listOptionValue builtIn="false" value="gameplay"/>
@@ -498,6 +503,7 @@
 									<listOptionValue builtIn="false" value="png14"/>
 									<listOptionValue builtIn="false" value="pps"/>
 									<listOptionValue builtIn="false" value="bps"/>
+									<listOptionValue builtIn="false" value="gestures"/>
 									<listOptionValue builtIn="false" value="OpenAL"/>
 									<listOptionValue builtIn="false" value="asound"/>
 									<listOptionValue builtIn="false" value="gameplay"/>
@@ -585,6 +591,7 @@
 									<listOptionValue builtIn="false" value="png14"/>
 									<listOptionValue builtIn="false" value="pps"/>
 									<listOptionValue builtIn="false" value="bps"/>
+									<listOptionValue builtIn="false" value="gestures"/>
 									<listOptionValue builtIn="false" value="OpenAL"/>
 									<listOptionValue builtIn="false" value="asound"/>
 									<listOptionValue builtIn="false" value="gameplay"/>

+ 3 - 0
gameplay/android/jni/Android.mk

@@ -53,6 +53,7 @@ LOCAL_SRC_FILES := \
     Game.cpp \
     Gamepad.cpp \
     gameplay-main-android.cpp \
+	Gesture.cpp \
     Image.cpp \
     Joint.cpp \
     Joystick.cpp \
@@ -167,6 +168,8 @@ LOCAL_SRC_FILES := \
     lua/lua_GamepadButtonState.cpp \
     lua/lua_GamepadGamepadEvent.cpp \
     lua/lua_GameState.cpp \
+	lua/lua_Gesture.cpp \
+	lua/lua_GestureGestureEvent.cpp \
     lua/lua_Global.cpp \
     lua/lua_Image.cpp \
     lua/lua_ImageFormat.cpp \

+ 267 - 0
gameplay/src/lua/lua_Game.cpp

@@ -11,6 +11,7 @@
 #include "lua_GameClearFlags.h"
 #include "lua_GameState.h"
 #include "lua_GamepadGamepadEvent.h"
+#include "lua_GestureGestureEvent.h"
 #include "lua_KeyboardKeyEvent.h"
 #include "lua_MouseMouseEvent.h"
 #include "lua_TouchTouchEvent.h"
@@ -27,6 +28,11 @@ void luaRegister_Game()
         {"exit", lua_Game_exit},
         {"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},
         {"getAnimationController", lua_Game_getAnimationController},
@@ -52,6 +58,7 @@ void luaRegister_Game()
         {"menuEvent", lua_Game_menuEvent},
         {"mouseEvent", lua_Game_mouseEvent},
         {"pause", lua_Game_pause},
+        {"recognizeGesture", lua_Game_recognizeGesture},
         {"resume", lua_Game_resume},
         {"run", lua_Game_run},
         {"schedule", lua_Game_schedule},
@@ -365,6 +372,228 @@ int lua_Game_gamepadEvent(lua_State* state)
     return 0;
 }
 
+int lua_Game_gesturePinchEvent(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->gesturePinchEvent(param1, param2, param3);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Game_gesturePinchEvent - 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_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.
+    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.
+                int param3 = (int)luaL_checkint(state, 4);
+
+                Game* instance = getInstance(state);
+                instance->gestureSwipeEvent(param1, param2, param3);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Game_gestureSwipeEvent - 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_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.
+    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->gestureTapEvent(param1, param2);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Game_gestureTapEvent - 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_getAIController(lua_State* state)
 {
     // Get the number of parameters.
@@ -1395,6 +1624,44 @@ int lua_Game_pause(lua_State* state)
     return 0;
 }
 
+int lua_Game_recognizeGesture(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->recognizeGesture(param1);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Game_recognizeGesture - 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_resume(lua_State* state)
 {
     // Get the number of parameters.

+ 6 - 0
gameplay/src/lua/lua_Game.h

@@ -11,6 +11,11 @@ int lua_Game_displayKeyboard(lua_State* state);
 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);
 int lua_Game_getAnimationController(lua_State* state);
@@ -36,6 +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_resume(lua_State* state);
 int lua_Game_run(lua_State* state);
 int lua_Game_schedule(lua_State* state);

+ 143 - 0
gameplay/src/lua/lua_Gesture.cpp

@@ -0,0 +1,143 @@
+#include "Base.h"
+#include "ScriptController.h"
+#include "lua_Gesture.h"
+#include "Gesture.h"
+
+namespace gameplay
+{
+
+void luaRegister_Gesture()
+{
+    const luaL_Reg lua_members[] = 
+    {
+        {NULL, NULL}
+    };
+    const luaL_Reg lua_statics[] = 
+    {
+        {"SWIPE_DIRECTION_DOWN", lua_Gesture_static_SWIPE_DIRECTION_DOWN},
+        {"SWIPE_DIRECTION_LEFT", lua_Gesture_static_SWIPE_DIRECTION_LEFT},
+        {"SWIPE_DIRECTION_RIGHT", lua_Gesture_static_SWIPE_DIRECTION_RIGHT},
+        {"SWIPE_DIRECTION_UP", lua_Gesture_static_SWIPE_DIRECTION_UP},
+        {NULL, NULL}
+    };
+    std::vector<std::string> scopePath;
+
+    ScriptUtil::registerClass("Gesture", lua_members, NULL, lua_Gesture__gc, lua_statics, scopePath);
+}
+
+static Gesture* getInstance(lua_State* state)
+{
+    void* userdata = luaL_checkudata(state, 1, "Gesture");
+    luaL_argcheck(state, userdata != NULL, 1, "'Gesture' expected.");
+    return (Gesture*)((ScriptUtil::LuaObject*)userdata)->instance;
+}
+
+int lua_Gesture__gc(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_TUSERDATA))
+            {
+                void* userdata = luaL_checkudata(state, 1, "Gesture");
+                luaL_argcheck(state, userdata != NULL, 1, "'Gesture' expected.");
+                ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)userdata;
+                if (object->owns)
+                {
+                    Gesture* instance = (Gesture*)object->instance;
+                    SAFE_DELETE(instance);
+                }
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Gesture__gc - 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_Gesture_static_SWIPE_DIRECTION_DOWN(lua_State* state)
+{
+    // Validate the number of parameters.
+    if (lua_gettop(state) > 0)
+    {
+        lua_pushstring(state, "Invalid number of parameters (expected 0).");
+        lua_error(state);
+    }
+
+    int result = Gesture::SWIPE_DIRECTION_DOWN;
+
+    // Push the return value onto the stack.
+    lua_pushinteger(state, result);
+
+    return 1;
+}
+
+int lua_Gesture_static_SWIPE_DIRECTION_LEFT(lua_State* state)
+{
+    // Validate the number of parameters.
+    if (lua_gettop(state) > 0)
+    {
+        lua_pushstring(state, "Invalid number of parameters (expected 0).");
+        lua_error(state);
+    }
+
+    int result = Gesture::SWIPE_DIRECTION_LEFT;
+
+    // Push the return value onto the stack.
+    lua_pushinteger(state, result);
+
+    return 1;
+}
+
+int lua_Gesture_static_SWIPE_DIRECTION_RIGHT(lua_State* state)
+{
+    // Validate the number of parameters.
+    if (lua_gettop(state) > 0)
+    {
+        lua_pushstring(state, "Invalid number of parameters (expected 0).");
+        lua_error(state);
+    }
+
+    int result = Gesture::SWIPE_DIRECTION_RIGHT;
+
+    // Push the return value onto the stack.
+    lua_pushinteger(state, result);
+
+    return 1;
+}
+
+int lua_Gesture_static_SWIPE_DIRECTION_UP(lua_State* state)
+{
+    // Validate the number of parameters.
+    if (lua_gettop(state) > 0)
+    {
+        lua_pushstring(state, "Invalid number of parameters (expected 0).");
+        lua_error(state);
+    }
+
+    int result = Gesture::SWIPE_DIRECTION_UP;
+
+    // Push the return value onto the stack.
+    lua_pushinteger(state, result);
+
+    return 1;
+}
+
+}

+ 18 - 0
gameplay/src/lua/lua_Gesture.h

@@ -0,0 +1,18 @@
+#ifndef LUA_GESTURE_H_
+#define LUA_GESTURE_H_
+
+namespace gameplay
+{
+
+// Lua bindings for Gesture.
+int lua_Gesture__gc(lua_State* state);
+int lua_Gesture_static_SWIPE_DIRECTION_DOWN(lua_State* state);
+int lua_Gesture_static_SWIPE_DIRECTION_LEFT(lua_State* state);
+int lua_Gesture_static_SWIPE_DIRECTION_RIGHT(lua_State* state);
+int lua_Gesture_static_SWIPE_DIRECTION_UP(lua_State* state);
+
+void luaRegister_Gesture();
+
+}
+
+#endif

+ 53 - 0
gameplay/src/lua/lua_GestureGestureEvent.cpp

@@ -0,0 +1,53 @@
+#include "Base.h"
+#include "lua_GestureGestureEvent.h"
+
+namespace gameplay
+{
+
+static const char* enumStringEmpty = "";
+
+static const char* luaEnumString_GestureGestureEvent_SWIPE = "SWIPE";
+static const char* luaEnumString_GestureGestureEvent_PINCH = "PINCH";
+static const char* luaEnumString_GestureGestureEvent_ROTATE = "ROTATE";
+static const char* luaEnumString_GestureGestureEvent_TAP = "TAP";
+static const char* luaEnumString_GestureGestureEvent_TAP_DOUBLE = "TAP_DOUBLE";
+static const char* luaEnumString_GestureGestureEvent_NONE = "NONE";
+
+Gesture::GestureEvent lua_enumFromString_GestureGestureEvent(const char* s)
+{
+    if (strcmp(s, luaEnumString_GestureGestureEvent_SWIPE) == 0)
+        return Gesture::SWIPE;
+    if (strcmp(s, luaEnumString_GestureGestureEvent_PINCH) == 0)
+        return Gesture::PINCH;
+    if (strcmp(s, luaEnumString_GestureGestureEvent_ROTATE) == 0)
+        return Gesture::ROTATE;
+    if (strcmp(s, luaEnumString_GestureGestureEvent_TAP) == 0)
+        return Gesture::TAP;
+    if (strcmp(s, luaEnumString_GestureGestureEvent_TAP_DOUBLE) == 0)
+        return Gesture::TAP_DOUBLE;
+    if (strcmp(s, luaEnumString_GestureGestureEvent_NONE) == 0)
+        return Gesture::NONE;
+    GP_ERROR("Invalid enumeration value '%s' for enumeration Gesture::GestureEvent.", s);
+    return Gesture::SWIPE;
+}
+
+const char* lua_stringFromEnum_GestureGestureEvent(Gesture::GestureEvent e)
+{
+    if (e == Gesture::SWIPE)
+        return luaEnumString_GestureGestureEvent_SWIPE;
+    if (e == Gesture::PINCH)
+        return luaEnumString_GestureGestureEvent_PINCH;
+    if (e == Gesture::ROTATE)
+        return luaEnumString_GestureGestureEvent_ROTATE;
+    if (e == Gesture::TAP)
+        return luaEnumString_GestureGestureEvent_TAP;
+    if (e == Gesture::TAP_DOUBLE)
+        return luaEnumString_GestureGestureEvent_TAP_DOUBLE;
+    if (e == Gesture::NONE)
+        return luaEnumString_GestureGestureEvent_NONE;
+    GP_ERROR("Invalid enumeration value '%d' for enumeration Gesture::GestureEvent.", e);
+    return enumStringEmpty;
+}
+
+}
+

+ 15 - 0
gameplay/src/lua/lua_GestureGestureEvent.h

@@ -0,0 +1,15 @@
+#ifndef LUA_GESTUREGESTUREEVENT_H_
+#define LUA_GESTUREGESTUREEVENT_H_
+
+#include "Gesture.h"
+
+namespace gameplay
+{
+
+// Lua bindings for enum conversion functions for Gesture::GestureEvent.
+Gesture::GestureEvent lua_enumFromString_GestureGestureEvent(const char* s);
+const char* lua_stringFromEnum_GestureGestureEvent(Gesture::GestureEvent e);
+
+}
+
+#endif

+ 14 - 0
gameplay/src/lua/lua_Global.cpp

@@ -356,6 +356,18 @@ void luaRegister_lua_Global()
         ScriptUtil::registerConstantString("DISCONNECTED_EVENT", "DISCONNECTED_EVENT", scopePath);
     }
 
+    // Register enumeration Gesture::GestureEvent.
+    {
+        std::vector<std::string> scopePath;
+        scopePath.push_back("Gesture");
+        ScriptUtil::registerConstantString("SWIPE", "SWIPE", scopePath);
+        ScriptUtil::registerConstantString("PINCH", "PINCH", scopePath);
+        ScriptUtil::registerConstantString("ROTATE", "ROTATE", scopePath);
+        ScriptUtil::registerConstantString("TAP", "TAP", scopePath);
+        ScriptUtil::registerConstantString("TAP_DOUBLE", "TAP_DOUBLE", scopePath);
+        ScriptUtil::registerConstantString("NONE", "NONE", scopePath);
+    }
+
     // Register enumeration Image::Format.
     {
         std::vector<std::string> scopePath;
@@ -799,6 +811,8 @@ const char* lua_stringFromEnumGlobal(std::string& enumname, unsigned int value)
         return lua_stringFromEnum_GamepadButtonState((Gamepad::ButtonState)value);
     if (enumname == "Gamepad::GamepadEvent")
         return lua_stringFromEnum_GamepadGamepadEvent((Gamepad::GamepadEvent)value);
+    if (enumname == "Gesture::GestureEvent")
+        return lua_stringFromEnum_GestureGestureEvent((Gesture::GestureEvent)value);
     if (enumname == "Image::Format")
         return lua_stringFromEnum_ImageFormat((Image::Format)value);
     if (enumname == "Keyboard::Key")

+ 1 - 0
gameplay/src/lua/lua_Global.h

@@ -17,6 +17,7 @@
 #include "lua_GameState.h"
 #include "lua_GamepadButtonState.h"
 #include "lua_GamepadGamepadEvent.h"
+#include "lua_GestureGestureEvent.h"
 #include "lua_ImageFormat.h"
 #include "lua_KeyboardKey.h"
 #include "lua_KeyboardKeyEvent.h"

+ 38 - 0
gameplay/src/lua/lua_Platform.cpp

@@ -2,6 +2,7 @@
 #include "ScriptController.h"
 #include "lua_Platform.h"
 #include "Platform.h"
+#include "lua_.h"
 #include "lua_KeyboardKeyEvent.h"
 #include "lua_MouseMouseEvent.h"
 #include "lua_TouchTouchEvent.h"
@@ -42,6 +43,7 @@ void luaRegister_Platform()
         {"isVsync", lua_Platform_static_isVsync},
         {"keyEventInternal", lua_Platform_static_keyEventInternal},
         {"mouseEventInternal", lua_Platform_static_mouseEventInternal},
+        {"recognizeGesture", lua_Platform_static_recognizeGesture},
         {"setAbsoluteTime", lua_Platform_static_setAbsoluteTime},
         {"setCursorVisible", lua_Platform_static_setCursorVisible},
         {"setMouseCaptured", lua_Platform_static_setMouseCaptured},
@@ -1015,6 +1017,42 @@ int lua_Platform_static_mouseEventInternal(lua_State* state)
     return 0;
 }
 
+int lua_Platform_static_recognizeGesture(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.
+                 param1 = ()lua_enumFromString_(luaL_checkstring(state, 1));
+
+                Platform::recognizeGesture(param1);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Platform_static_recognizeGesture - 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_setAbsoluteTime(lua_State* state)
 {
     // Get the number of parameters.

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

@@ -31,6 +31,7 @@ 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_setAbsoluteTime(lua_State* state);
 int lua_Platform_static_setCursorVisible(lua_State* state);
 int lua_Platform_static_setMouseCaptured(lua_State* state);

+ 1 - 0
gameplay/src/lua/lua_all_bindings.cpp

@@ -45,6 +45,7 @@ void lua_RegisterAllBindings()
     luaRegister_Frustum();
     luaRegister_Game();
     luaRegister_Gamepad();
+    luaRegister_Gesture();
     luaRegister_Image();
     luaRegister_Joint();
     luaRegister_Joystick();

+ 1 - 0
gameplay/src/lua/lua_all_bindings.h

@@ -40,6 +40,7 @@
 #include "lua_Frustum.h"
 #include "lua_Game.h"
 #include "lua_Gamepad.h"
+#include "lua_Gesture.h"
 #include "lua_Image.h"
 #include "lua_Joint.h"
 #include "lua_Joystick.h"