updated to latest love-android (changeset 7b5f223900b)

This commit is contained in:
fysx
2015-01-22 10:48:45 +01:00
parent 31cd05551e
commit 542c029666
22 changed files with 529 additions and 53 deletions
+2
View File
@@ -75,6 +75,8 @@ public:
virtual bool isVisible() const = 0;
virtual void setGrabbed(bool grab) = 0;
virtual bool isGrabbed() const = 0;
virtual bool setRelative(bool relative) = 0;
virtual bool isRelative() const = 0;
static bool getConstant(const char *in, Button &out);
static bool getConstant(Button in, const char *&out);
+10
View File
@@ -220,6 +220,16 @@ bool Mouse::isGrabbed() const
return false;
}
bool Mouse::setRelative(bool relative)
{
return SDL_SetRelativeMouseMode(relative ? SDL_TRUE : SDL_FALSE) == 0;
}
bool Mouse::isRelative() const
{
return SDL_GetRelativeMouseMode() != SDL_FALSE;
}
} // sdl
} // mouse
} // love
+2
View File
@@ -66,6 +66,8 @@ public:
bool isVisible() const;
void setGrabbed(bool grab);
bool isGrabbed() const;
bool setRelative(bool relative);
bool isRelative() const;
private:
+15
View File
@@ -185,6 +185,19 @@ int w_isGrabbed(lua_State *L)
return 1;
}
int w_setRelative(lua_State *L)
{
bool relative = luax_toboolean(L, 1);
luax_pushboolean(L, instance()->setRelative(relative));
return 1;
}
int w_isRelative(lua_State *L)
{
luax_pushboolean(L, instance()->isRelative());
return 1;
}
// List of functions to wrap.
static const luaL_Reg functions[] =
{
@@ -204,6 +217,8 @@ static const luaL_Reg functions[] =
{ "getPosition", w_getPosition },
{ "setGrabbed", w_setGrabbed },
{ "isGrabbed", w_isGrabbed },
{ "setRelative", w_setRelative },
{ "isRelative", w_isRelative },
{ 0, 0 }
};
+2
View File
@@ -46,6 +46,8 @@ int w_setVisible(lua_State *L);
int w_isVisible(lua_State *L);
int w_setGrabbed(lua_State *L);
int w_isGrabbed(lua_State *L);
int w_setRelative(lua_State *L);
int w_isRelative(lua_State *L);
extern "C" LOVE_EXPORT int luaopen_love_mouse(lua_State *L);
} // mouse