| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067 |
- #include "Base.h"
- #include "ScriptController.h"
- #include "lua_Platform.h"
- #include "Platform.h"
- #include "lua_GestureGestureEvent.h"
- #include "lua_KeyboardKeyEvent.h"
- #include "lua_MouseMouseEvent.h"
- #include "lua_TouchTouchEvent.h"
- namespace gameplay
- {
- void luaRegister_Platform()
- {
- const luaL_Reg lua_members[] =
- {
- {"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},
- {"keyEventInternal", lua_Platform_static_keyEventInternal},
- {"launchURL", lua_Platform_static_launchURL},
- {"mouseEventInternal", lua_Platform_static_mouseEventInternal},
- {"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},
- {"touchEventInternal", lua_Platform_static_touchEventInternal},
- {"unregisterGesture", lua_Platform_static_unregisterGesture},
- {NULL, NULL}
- };
- std::vector<std::string> scopePath;
- ScriptUtil::registerClass("Platform", lua_members, NULL, lua_Platform__gc, lua_statics, scopePath);
- }
- static Platform* getInstance(lua_State* state)
- {
- void* userdata = luaL_checkudata(state, 1, "Platform");
- luaL_argcheck(state, userdata != NULL, 1, "'Platform' expected.");
- return (Platform*)((ScriptUtil::LuaObject*)userdata)->instance;
- }
- int lua_Platform__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, "Platform");
- luaL_argcheck(state, userdata != NULL, 1, "'Platform' expected.");
- ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)userdata;
- if (object->owns)
- {
- Platform* instance = (Platform*)object->instance;
- SAFE_DELETE(instance);
- }
-
- return 0;
- }
- lua_pushstring(state, "lua_Platform__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_Platform_enterMessagePump(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))
- {
- Platform* instance = getInstance(state);
- int result = instance->enterMessagePump();
- // Push the return value onto the stack.
- lua_pushinteger(state, result);
- return 1;
- }
- lua_pushstring(state, "lua_Platform_enterMessagePump - 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_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_keyEventInternal(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_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
- lua_type(state, 2) == LUA_TNUMBER)
- {
- // Get parameter 1 off the stack.
- Keyboard::KeyEvent param1 = (Keyboard::KeyEvent)lua_enumFromString_KeyboardKeyEvent(luaL_checkstring(state, 1));
- // Get parameter 2 off the stack.
- int param2 = (int)luaL_checkint(state, 2);
- Platform::keyEventInternal(param1, param2);
-
- return 0;
- }
- lua_pushstring(state, "lua_Platform_static_keyEventInternal - 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_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.
- ScriptUtil::LuaArray<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_mouseEventInternal(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_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
- lua_type(state, 2) == LUA_TNUMBER &&
- lua_type(state, 3) == LUA_TNUMBER &&
- lua_type(state, 4) == LUA_TNUMBER)
- {
- // Get parameter 1 off the stack.
- Mouse::MouseEvent param1 = (Mouse::MouseEvent)lua_enumFromString_MouseMouseEvent(luaL_checkstring(state, 1));
- // Get parameter 2 off the stack.
- int param2 = (int)luaL_checkint(state, 2);
- // Get parameter 3 off the stack.
- int param3 = (int)luaL_checkint(state, 3);
- // Get parameter 4 off the stack.
- int param4 = (int)luaL_checkint(state, 4);
- bool result = Platform::mouseEventInternal(param1, param2, param3, param4);
- // Push the return value onto the stack.
- lua_pushboolean(state, result);
- return 1;
- }
- lua_pushstring(state, "lua_Platform_static_mouseEventInternal - 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_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, ¶m1Valid);
- 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_touchEventInternal(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_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
- lua_type(state, 2) == LUA_TNUMBER &&
- lua_type(state, 3) == LUA_TNUMBER &&
- lua_type(state, 4) == LUA_TNUMBER)
- {
- // Get parameter 1 off the stack.
- Touch::TouchEvent param1 = (Touch::TouchEvent)lua_enumFromString_TouchTouchEvent(luaL_checkstring(state, 1));
- // Get parameter 2 off the stack.
- int param2 = (int)luaL_checkint(state, 2);
- // Get parameter 3 off the stack.
- int param3 = (int)luaL_checkint(state, 3);
- // Get parameter 4 off the stack.
- unsigned int param4 = (unsigned int)luaL_checkunsigned(state, 4);
- Platform::touchEventInternal(param1, param2, param3, param4);
-
- return 0;
- }
- lua_pushstring(state, "lua_Platform_static_touchEventInternal - 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_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;
- }
- }
|