Kaynağa Gözat

Merge pull request #726 from seanpaultaylor/next

Made the Platform abstraction methods used only by Game private.
Sean Paul Taylor 13 yıl önce
ebeveyn
işleme
486c2794e3

+ 40 - 65
gameplay/src/Platform.h

@@ -14,12 +14,19 @@ namespace gameplay
 class Game;
 
 /**
- * Defines a platform.
+ * Defines a platform abstraction.
+ * 
+ * This class has only a few public methods for creating a platform 
+ *
  */
 class Platform
 {
 public:
 
+    friend class Game;
+    friend class Gamepad;
+    friend class ScreenDisplayer;
+
     /**
      * Destructor.
      */
@@ -48,6 +55,8 @@ public:
      * @return The platform message pump return code.
      */
     int enterMessagePump();
+
+private:
     
     /**
      * This method informs the platform that the game is shutting down 
@@ -230,98 +239,64 @@ public:
     static void pollGamepadState(Gamepad* gamepad);
 
     /**
-     * Touch callback on touch events. This method handles passing the touch event to the form or to the game.
+     * Opens an URL in an external browser, if available.
      *
-     * @param evt The touch event that occurred.
-     * @param x The x position of the touch in pixels. Left edge is zero.
-     * @param y The y position of the touch in pixels. Top edge is zero.
-     * @param contactIndex An integer to identify this contact point within the currently active touch set.
+     * @param url URL to be opened.
+     *
+     * @return True if URL was opened successfully, false otherwise.
+     */
+    static bool launchURL(const char* url);
+
+    /**
+     * Constructor.
+     */
+    Platform(Game* game);
+
+    /**
+     * Constructor.
+     */
+    Platform(const Platform& copy);
+
+public:
+
+   /**
+     * Internal method used only from static code in various platform implementation.
      *
-     * @see Touch::TouchEvent
      * @script{ignore}
      */
     static void touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex);
 
-    /**
-     * Keyboard callback on keyPress events.
+   /**
+     * Internal method used only from static code in various platform implementation.
      *
-     * @param evt The key event that occurred.
-     * @param key If evt is KEY_PRESS or KEY_RELEASE then key is the key code from Keyboard::Key.
-     *            If evt is KEY_CHAR then key is the unicode value of the character.
-     * 
-     * @see Keyboard::KeyEvent
-     * @see Keyboard::Key
      * @script{ignore}
      */
     static void keyEventInternal(Keyboard::KeyEvent evt, int key);
 
-    /**
-     * Mouse callback on mouse events. If the game does not consume the mouse move event or left mouse click event
-     * then it is interpreted as a touch event instead.
-     *
-     * @param evt The mouse event that occurred.
-     * @param x The x position of the mouse in pixels. Left edge is zero.
-     * @param y The y position of the mouse in pixels. Top edge is zero.
-     * @param wheelDelta The number of mouse wheel ticks. Positive is up (forward), negative is down (backward).
-     *
-     * @return True if the mouse event is consumed or false if it is not consumed.
+   /**
+     * Internal method used only from static code in various platform implementation.
      *
-     * @see Mouse::MouseEvent
      * @script{ignore}
      */
     static bool mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta);
 
-    /**
-     * Gamepad callback from platform on gamepad events when a gamepad is connected.
-     *
-     * @param handle The gamepad handle
-     * @param buttonCount The number of buttons
-     * @param joystickCount The number of joysticks
-     * @param triggerCount The number of triggers
-     * @param vendorId The vendor id
-     * @param productId The product id
-     * @param vendorString The vendor string/name.
-     * @param productString The product string/name.
+   /**
+     * Internal method used only from static code in various platform implementation.
      *
-     * @see Gamepad::GamepadEvent
      * @script{ignore}
      */
-    static void gamepadEventConnectedInternal(GamepadHandle handle, 
-                                              unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount,
+    static void gamepadEventConnectedInternal(GamepadHandle handle, unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount,
                                               unsigned int vendorId, unsigned int productId, 
                                               const char* vendorString, const char* productString);
-
-    /**
-     * Gamepad callback from platform on gamepad events when a gamepad is disconnected.
-     *
-     * @param handle The gamepad handle
+   /**
+     * Internal method used only from static code in various platform implementation.
      *
-     * @see Gamepad::GamepadEvent
      * @script{ignore}
      */
     static void gamepadEventDisconnectedInternal(GamepadHandle handle);
 
-    /**
-     * Opens an URL in an external browser, if available.
-     *
-     * @param url URL to be opened.
-     *
-     * @return True if URL was opened successfully, false otherwise.
-     */
-    static bool launchURL(const char* url);
-    
 private:
 
-    /**
-     * Constructor.
-     */
-    Platform(Game* game);
-
-    /**
-     * Constructor.
-     */
-    Platform(const Platform& copy);
-
     Game* _game;                // The game this platform is interfacing with.
 };
 

+ 1 - 827
gameplay/src/lua/lua_Platform.cpp

@@ -2,7 +2,6 @@
 #include "ScriptController.h"
 #include "lua_Platform.h"
 #include "Platform.h"
-#include "lua_GestureGestureEvent.h"
 
 namespace gameplay
 {
@@ -14,35 +13,7 @@ void luaRegister_Platform()
         {"enterMessagePump", lua_Platform_enterMessagePump},
         {NULL, NULL}
     };
-    const luaL_Reg lua_statics[] = 
-    {
-        {"canExit", lua_Platform_static_canExit},
-        {"displayKeyboard", lua_Platform_static_displayKeyboard},
-        {"getAbsoluteTime", lua_Platform_static_getAbsoluteTime},
-        {"getAccelerometerValues", lua_Platform_static_getAccelerometerValues},
-        {"getDisplayHeight", lua_Platform_static_getDisplayHeight},
-        {"getDisplayWidth", lua_Platform_static_getDisplayWidth},
-        {"hasMouse", lua_Platform_static_hasMouse},
-        {"isCursorVisible", lua_Platform_static_isCursorVisible},
-        {"isGestureRegistered", lua_Platform_static_isGestureRegistered},
-        {"isGestureSupported", lua_Platform_static_isGestureSupported},
-        {"isMouseCaptured", lua_Platform_static_isMouseCaptured},
-        {"isMultiTouch", lua_Platform_static_isMultiTouch},
-        {"isVsync", lua_Platform_static_isVsync},
-        {"launchURL", lua_Platform_static_launchURL},
-        {"pollGamepadState", lua_Platform_static_pollGamepadState},
-        {"registerGesture", lua_Platform_static_registerGesture},
-        {"setAbsoluteTime", lua_Platform_static_setAbsoluteTime},
-        {"setCursorVisible", lua_Platform_static_setCursorVisible},
-        {"setMouseCaptured", lua_Platform_static_setMouseCaptured},
-        {"setMultiTouch", lua_Platform_static_setMultiTouch},
-        {"setVsync", lua_Platform_static_setVsync},
-        {"signalShutdown", lua_Platform_static_signalShutdown},
-        {"sleep", lua_Platform_static_sleep},
-        {"swapBuffers", lua_Platform_static_swapBuffers},
-        {"unregisterGesture", lua_Platform_static_unregisterGesture},
-        {NULL, NULL}
-    };
+    const luaL_Reg* lua_statics = NULL;
     std::vector<std::string> scopePath;
 
     ScriptUtil::registerClass("Platform", lua_members, NULL, lua_Platform__gc, lua_statics, scopePath);
@@ -128,801 +99,4 @@ int lua_Platform_enterMessagePump(lua_State* state)
     return 0;
 }
 
-int lua_Platform_static_canExit(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 0:
-        {
-            bool result = Platform::canExit();
-
-            // Push the return value onto the stack.
-            lua_pushboolean(state, result);
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Platform_static_displayKeyboard(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_TBOOLEAN)
-            {
-                // Get parameter 1 off the stack.
-                bool param1 = ScriptUtil::luaCheckBool(state, 1);
-
-                Platform::displayKeyboard(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_displayKeyboard - 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_getAbsoluteTime(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 0:
-        {
-            double result = Platform::getAbsoluteTime();
-
-            // Push the return value onto the stack.
-            lua_pushnumber(state, result);
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Platform_static_getAccelerometerValues(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_TTABLE || lua_type(state, 1) == LUA_TLIGHTUSERDATA) &&
-                (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA))
-            {
-                // Get parameter 1 off the stack.
-                ScriptUtil::LuaArray<float> param1 = ScriptUtil::getFloatPointer(1);
-
-                // Get parameter 2 off the stack.
-                ScriptUtil::LuaArray<float> param2 = ScriptUtil::getFloatPointer(2);
-
-                Platform::getAccelerometerValues(param1, param2);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_getAccelerometerValues - 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_Platform_static_getDisplayHeight(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 0:
-        {
-            unsigned int result = Platform::getDisplayHeight();
-
-            // Push the return value onto the stack.
-            lua_pushunsigned(state, result);
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Platform_static_getDisplayWidth(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 0:
-        {
-            unsigned int result = Platform::getDisplayWidth();
-
-            // Push the return value onto the stack.
-            lua_pushunsigned(state, result);
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Platform_static_hasMouse(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 0:
-        {
-            bool result = Platform::hasMouse();
-
-            // Push the return value onto the stack.
-            lua_pushboolean(state, result);
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Platform_static_isCursorVisible(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 0:
-        {
-            bool result = Platform::isCursorVisible();
-
-            // Push the return value onto the stack.
-            lua_pushboolean(state, result);
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Platform_static_isGestureRegistered(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::isGestureRegistered(param1);
-
-                // Push the return value onto the stack.
-                lua_pushboolean(state, result);
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_isGestureRegistered - 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_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;
-            }
-
-            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.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 0:
-        {
-            bool result = Platform::isMouseCaptured();
-
-            // Push the return value onto the stack.
-            lua_pushboolean(state, result);
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Platform_static_isMultiTouch(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 0:
-        {
-            bool result = Platform::isMultiTouch();
-
-            // Push the return value onto the stack.
-            lua_pushboolean(state, result);
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Platform_static_isVsync(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 0:
-        {
-            bool result = Platform::isVsync();
-
-            // Push the return value onto the stack.
-            lua_pushboolean(state, result);
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Platform_static_launchURL(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.
-                const char* param1 = ScriptUtil::getString(1, false);
-
-                bool result = Platform::launchURL(param1);
-
-                // Push the return value onto the stack.
-                lua_pushboolean(state, result);
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_launchURL - 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_pollGamepadState(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 || lua_type(state, 1) == LUA_TTABLE || lua_type(state, 1) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                bool param1Valid;
-                ScriptUtil::LuaArray<Gamepad> param1 = ScriptUtil::getObjectPointer<Gamepad>(1, "Gamepad", false, &param1Valid);
-                if (!param1Valid)
-                {
-                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Gamepad'.");
-                    lua_error(state);
-                }
-
-                Platform::pollGamepadState(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_pollGamepadState - 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_registerGesture(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::registerGesture(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_registerGesture - 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.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if (lua_type(state, 1) == LUA_TNUMBER)
-            {
-                // Get parameter 1 off the stack.
-                double param1 = (double)luaL_checknumber(state, 1);
-
-                Platform::setAbsoluteTime(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_setAbsoluteTime - 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_setCursorVisible(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_TBOOLEAN)
-            {
-                // Get parameter 1 off the stack.
-                bool param1 = ScriptUtil::luaCheckBool(state, 1);
-
-                Platform::setCursorVisible(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_setCursorVisible - 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_setMouseCaptured(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_TBOOLEAN)
-            {
-                // Get parameter 1 off the stack.
-                bool param1 = ScriptUtil::luaCheckBool(state, 1);
-
-                Platform::setMouseCaptured(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_setMouseCaptured - 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_setMultiTouch(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_TBOOLEAN)
-            {
-                // Get parameter 1 off the stack.
-                bool param1 = ScriptUtil::luaCheckBool(state, 1);
-
-                Platform::setMultiTouch(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_setMultiTouch - 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_setVsync(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_TBOOLEAN)
-            {
-                // Get parameter 1 off the stack.
-                bool param1 = ScriptUtil::luaCheckBool(state, 1);
-
-                Platform::setVsync(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_setVsync - 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_signalShutdown(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 0:
-        {
-            Platform::signalShutdown();
-            
-            return 0;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_Platform_static_sleep(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_TNUMBER)
-            {
-                // Get parameter 1 off the stack.
-                long param1 = (long)luaL_checklong(state, 1);
-
-                Platform::sleep(param1);
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_Platform_static_sleep - 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_swapBuffers(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 0:
-        {
-            Platform::swapBuffers();
-            
-            return 0;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    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;
-            }
-
-            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;
-}
-
 }

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

@@ -7,31 +7,6 @@ namespace gameplay
 // Lua bindings for Platform.
 int lua_Platform__gc(lua_State* state);
 int lua_Platform_enterMessagePump(lua_State* state);
-int lua_Platform_static_canExit(lua_State* state);
-int lua_Platform_static_displayKeyboard(lua_State* state);
-int lua_Platform_static_getAbsoluteTime(lua_State* state);
-int lua_Platform_static_getAccelerometerValues(lua_State* state);
-int lua_Platform_static_getDisplayHeight(lua_State* state);
-int lua_Platform_static_getDisplayWidth(lua_State* state);
-int lua_Platform_static_hasMouse(lua_State* state);
-int lua_Platform_static_isCursorVisible(lua_State* state);
-int lua_Platform_static_isGestureRegistered(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_launchURL(lua_State* state);
-int lua_Platform_static_pollGamepadState(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);
-int lua_Platform_static_setMultiTouch(lua_State* state);
-int lua_Platform_static_setVsync(lua_State* state);
-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_unregisterGesture(lua_State* state);
 
 void luaRegister_Platform();