diff --git a/src/event.c b/src/event.c index 173ce8fd..59b208ba 100644 --- a/src/event.c +++ b/src/event.c @@ -1,11 +1,16 @@ #include "event.h" #include "lovr.h" #include +#include +#include +#include extern GLFWwindow* window; +extern OSVR_ClientContext ctx; int lovrEventPoll(lua_State* L) { glfwPollEvents(); + osvrClientUpdate(ctx); return 0; } diff --git a/src/interface.c b/src/interface.c index 317ecfd3..bd355d27 100644 --- a/src/interface.c +++ b/src/interface.c @@ -24,8 +24,6 @@ int lovrInterfaceGetPosition(lua_State* L) { OSVR_TimeValue t; OSVR_PositionState position; - osvrClientUpdate(ctx); - OSVR_ReturnCode res = osvrGetPositionState(*interface, &t, &position); if (res != OSVR_RETURN_SUCCESS) { diff --git a/src/main.c b/src/main.c index 032ef4eb..208abde8 100644 --- a/src/main.c +++ b/src/main.c @@ -16,14 +16,14 @@ int main(int argc, char* argv[]) { L = luaL_newstate(); luaL_openlibs(L); - //ctx = osvrClientInit("es.bjornbyt", 0); + ctx = osvrClientInit("es.bjornbyt", 0); initGlfw(lovrOnError, lovrOnClose); lovrInit(L); - /*if (osvrClientCheckStatus(ctx)) { + if (osvrClientCheckStatus(ctx)) { osvrClientShutdown(ctx); - }*/ + } lovrRun(L);