mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
18 lines
442 B
C++
18 lines
442 B
C++
#include "api_lua.hpp"
|
|
|
|
#include "../../../engine.hpp"
|
|
#include "../../../window/Window.hpp"
|
|
|
|
static int l_time_uptime(lua::State* L) {
|
|
return lua::pushnumber(L, Window::time());
|
|
}
|
|
|
|
static int l_time_delta(lua::State* L) {
|
|
return lua::pushnumber(L, scripting::engine->getDelta());
|
|
}
|
|
|
|
const luaL_Reg timelib [] = {
|
|
{"uptime", lua::wrap<l_time_uptime>},
|
|
{"delta", lua::wrap<l_time_delta>},
|
|
{NULL, NULL}
|
|
};
|