diff --git a/ag.cc b/ag.cc index af322e9..50af69d 100644 --- a/ag.cc +++ b/ag.cc @@ -29,6 +29,7 @@ namespace ag { "startFrame", startFrame }, { "endFrame", endFrame }, { "setCamera", setCamera }, + { "elapsedTime", elapsedTime }, { NULL, NULL } }; luaL_register(L, "ag", functions); @@ -188,6 +189,12 @@ namespace ag return g_engine->setCamera(L); } + int elapsedTime(lua_State * L) + { + lua_pushinteger(L, SDL_GetTicks()); + return 1; + } + namespace object { int draw(lua_State * L) diff --git a/ag.h b/ag.h index 4776e76..e146cd9 100644 --- a/ag.h +++ b/ag.h @@ -16,6 +16,7 @@ namespace ag int startFrame(lua_State * L); int endFrame(lua_State * L); int setCamera(lua_State * L); + int elapsedTime(lua_State * L); namespace object {