add 'test' library
This commit is contained in:
@@ -37,6 +37,7 @@ extern const luaL_Reg packlib[];
|
||||
extern const luaL_Reg particleslib[]; // gfx.particles
|
||||
extern const luaL_Reg playerlib[];
|
||||
extern const luaL_Reg quatlib[];
|
||||
extern const luaL_Reg testlib[];
|
||||
extern const luaL_Reg text3dlib[]; // gfx.text3d
|
||||
extern const luaL_Reg timelib[];
|
||||
extern const luaL_Reg tomllib[];
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "api_lua.hpp"
|
||||
|
||||
const luaL_Reg testlib[] = {
|
||||
{NULL, NULL}
|
||||
};
|
||||
@@ -2,15 +2,18 @@
|
||||
#include "window/Window.hpp"
|
||||
#include "api_lua.hpp"
|
||||
|
||||
static int l_time_uptime(lua::State* L) {
|
||||
return lua::pushnumber(L, Window::time());
|
||||
using namespace scripting;
|
||||
|
||||
static int l_uptime(lua::State* L) {
|
||||
return lua::pushnumber(L, engine->getUptime());
|
||||
}
|
||||
|
||||
static int l_time_delta(lua::State* L) {
|
||||
return lua::pushnumber(L, scripting::engine->getDelta());
|
||||
static int l_delta(lua::State* L) {
|
||||
return lua::pushnumber(L, engine->getDelta());
|
||||
}
|
||||
|
||||
const luaL_Reg timelib[] = {
|
||||
{"uptime", lua::wrap<l_time_uptime>},
|
||||
{"delta", lua::wrap<l_time_delta>},
|
||||
{NULL, NULL}};
|
||||
{"uptime", lua::wrap<l_uptime>},
|
||||
{"delta", lua::wrap<l_delta>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user