get_mouse_pos moved to input library

This commit is contained in:
MihailRis
2024-05-12 16:30:30 +03:00
parent 94825f7b05
commit 8de986346e
2 changed files with 6 additions and 6 deletions
+6
View File
@@ -1,4 +1,5 @@
#include "api_lua.hpp"
#include "lua_util.hpp"
#include "lua_commons.hpp"
#include "LuaState.hpp"
#include "../scripting.hpp"
@@ -39,9 +40,14 @@ static int l_add_callback(lua_State* L) {
return 0;
}
static int l_get_mouse_pos(lua_State* L) {
return lua::pushvec2_arr(L, Events::cursor);
}
const luaL_Reg inputlib [] = {
{"keycode", lua_wrap_errors<l_keycode>},
{"add_callback", lua_wrap_errors<l_add_callback>},
{"get_mouse_pos", lua_wrap_errors<l_get_mouse_pos>},
{NULL, NULL}
};