From 4f147c08fc5498af393729c5e4a3d91894c97467 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 2 Sep 2018 18:44:15 +0800 Subject: *update --- src/lua/modules/mouse/mouse.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/lua/modules/mouse/mouse.cpp') diff --git a/src/lua/modules/mouse/mouse.cpp b/src/lua/modules/mouse/mouse.cpp index f907abb..b7ce933 100644 --- a/src/lua/modules/mouse/mouse.cpp +++ b/src/lua/modules/mouse/mouse.cpp @@ -17,9 +17,17 @@ namespace lua return 2; } + static int l_setVisible(lua_State* L) + { + bool visible = luax_checkbool(L, 1); + SDL_ShowCursor(visible ? SDL_ENABLE : SDL_DISABLE); + return 0; + } + static const luaL_Reg f[] = { - { "position", l_pos }, - { 0, 0 } + { "position", l_pos }, + { "setVisible", l_setVisible }, + { 0, 0 } }; int luaopen_mouse(lua_State* L) -- cgit v1.1-26-g67d0