aboutsummaryrefslogtreecommitdiff
path: root/src/lua/mouse/luaopen_mouse.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-07-28 09:58:37 +0800
committerchai <chaifix@163.com>2018-07-28 09:58:37 +0800
commit61301a96d309fe2deef0d0dc2e2bc2f3d4003bf9 (patch)
treed335e4312b28addf40f13e7f49900e9b5e3058a7 /src/lua/mouse/luaopen_mouse.cpp
parent92dab582ccac31be7fa410e7f4fb3789e88a0629 (diff)
*update
Diffstat (limited to 'src/lua/mouse/luaopen_mouse.cpp')
-rw-r--r--src/lua/mouse/luaopen_mouse.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lua/mouse/luaopen_mouse.cpp b/src/lua/mouse/luaopen_mouse.cpp
index a013f3d..eb6a779 100644
--- a/src/lua/mouse/luaopen_mouse.cpp
+++ b/src/lua/mouse/luaopen_mouse.cpp
@@ -1,13 +1,17 @@
#include "lua/luax.h"
-#include "SDL2/SDL.h"
+#include "libjin/jin.h"
+
namespace jin
{
namespace lua
{
+ using namespace jin::input;
+
static int l_pos(lua_State* L)
{
+ static Mouse* mouse = Mouse::get();
int x, y;
- SDL_GetMouseState(&x, &y);
+ mouse->getState(&x, &y);
luax_pushnumber(L, x);
luax_pushnumber(L, y);
return 2;