aboutsummaryrefslogtreecommitdiff
path: root/src/lua/mouse/luaopen_mouse.cpp
diff options
context:
space:
mode:
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;