1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-07 06:43:34 +00:00
lovr/src/timer/timer.c
2016-08-08 03:43:51 -07:00

21 lines
350 B
C

#include "timer.h"
#include "../lovr.h"
#include "../glfw.h"
int lovrTimerStep(lua_State* L) {
lua_pushnumber(L, glfwGetTime());
glfwSetTime(0);
return 1;
}
const luaL_Reg lovrTimer[] = {
{ "step", lovrTimerStep },
{ NULL, NULL }
};
int lovrInitTimer(lua_State* L) {
lua_newtable(L);
luaL_register(L, NULL, lovrTimer);
return 1;
}