mirror of https://github.com/bjornbytes/lovr.git
OSVR improvements;
This commit is contained in:
parent
31bd3abf0b
commit
9bb4ad82ef
|
@ -1,11 +1,16 @@
|
|||
#include "event.h"
|
||||
#include "lovr.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <osvr/ClientKit/ContextC.h>
|
||||
#include <osvr/ClientKit/InterfaceC.h>
|
||||
#include <osvr/ClientKit/InterfaceStateC.h>
|
||||
|
||||
extern GLFWwindow* window;
|
||||
extern OSVR_ClientContext ctx;
|
||||
|
||||
int lovrEventPoll(lua_State* L) {
|
||||
glfwPollEvents();
|
||||
osvrClientUpdate(ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue