Skip to content
Snippets Groups Projects
Commit deb70f96 authored by DarkGod's avatar DarkGod
Browse files

hum

parent 99ab82f2
No related branches found
No related tags found
No related merge requests found
...@@ -355,11 +355,18 @@ static int lua_set_current_mousehandler(lua_State *L) ...@@ -355,11 +355,18 @@ static int lua_set_current_mousehandler(lua_State *L)
return 0; return 0;
} }
static int lua_mouse_show(lua_State *L)
{
SDL_ShowCursor(lua_toboolean(L, 1) ? TRUE : FALSE);
return 0;
}
static int lua_is_touch_enabled(lua_State *L) static int lua_is_touch_enabled(lua_State *L)
{ {
lua_pushboolean(L, SDL_GetNumTouchDevices() > 0); lua_pushboolean(L, SDL_GetNumTouchDevices() > 0);
return 1; return 1;
} }
static int lua_is_gamepad_enabled(lua_State *L) static int lua_is_gamepad_enabled(lua_State *L)
{ {
if (!SDL_NumJoysticks()) return 0; if (!SDL_NumJoysticks()) return 0;
...@@ -367,10 +374,12 @@ static int lua_is_gamepad_enabled(lua_State *L) ...@@ -367,10 +374,12 @@ static int lua_is_gamepad_enabled(lua_State *L)
lua_pushstring(L, str); lua_pushstring(L, str);
return 1; return 1;
} }
static const struct luaL_Reg mouselib[] = static const struct luaL_Reg mouselib[] =
{ {
{"touchCapable", lua_is_touch_enabled}, {"touchCapable", lua_is_touch_enabled},
{"gamepadCapable", lua_is_gamepad_enabled}, {"gamepadCapable", lua_is_gamepad_enabled},
{"show", lua_mouse_show},
{"get", lua_get_mouse}, {"get", lua_get_mouse},
{"set", lua_set_mouse}, {"set", lua_set_mouse},
{"set_current_handler", lua_set_current_mousehandler}, {"set_current_handler", lua_set_current_mousehandler},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment