diff --git a/README.md b/README.md index 2675134b..8b2d4411 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ a custom build. - GLFW (3.2+) - OpenGL (Unix) or GLEW (Windows) - assimp (for `lovr.model` and `lovr.graphics.newModel`) -- OpenVR (for `lovr.headset`) +- OpenVR (1.0.5, for `lovr.headset`) - PhysicsFS - OpenAL (1.17+ recommended for HRTF support) @@ -119,11 +119,11 @@ create and run a game from this point is: #### Unix (CMake) -First, clone [OpenVR](https://github.com/ValveSoftware/openvr) (v1.0.3). For this example, we'll clone +First, clone [OpenVR](https://github.com/ValveSoftware/openvr). For this example, we'll clone `openvr` into the same directory that `lovr` was cloned into. ```sh -git clone --branch v1.0.3 https://github.com/ValveSoftware/openvr.git +git clone --branch v1.0.5 https://github.com/ValveSoftware/openvr.git ``` Next, install the other dependencies above using your package manager of choice: diff --git a/src/headset/vive.c b/src/headset/vive.c index e95f87ab..f0be75a7 100644 --- a/src/headset/vive.c +++ b/src/headset/vive.c @@ -391,7 +391,7 @@ float viveControllerGetAxis(void* headset, Controller* controller, ControllerAxi Vive* vive = (Vive*) headset; VRControllerState_t input; - vive->system->GetControllerState(controller->id, &input); + vive->system->GetControllerState(controller->id, &input, sizeof(input)); switch (axis) { case CONTROLLER_AXIS_TRIGGER: @@ -414,7 +414,7 @@ int viveControllerIsDown(void* headset, Controller* controller, ControllerButton Vive* vive = (Vive*) headset; VRControllerState_t input; - vive->system->GetControllerState(controller->id, &input); + vive->system->GetControllerState(controller->id, &input, sizeof(input)); switch (button) { case CONTROLLER_BUTTON_SYSTEM: @@ -486,7 +486,6 @@ void viveRenderTo(void* headset, headsetRenderCallback callback, void* userdata) Vive* vive = (Vive*) headset; float headMatrix[16], eyeMatrix[16], projectionMatrix[16]; float (*matrix)[4]; - EGraphicsAPIConvention graphicsConvention = EGraphicsAPIConvention_API_OpenGL; vive->isRendering = 1; vive->compositor->WaitGetPoses(vive->renderPoses, 16, NULL, 0); @@ -502,7 +501,7 @@ void viveRenderTo(void* headset, headsetRenderCallback callback, void* userdata) float near = vive->clipNear; float far = vive->clipFar; - matrix = vive->system->GetProjectionMatrix(eye, near, far, graphicsConvention).m; + matrix = vive->system->GetProjectionMatrix(eye, near, far).m; mat4_fromMat44(projectionMatrix, matrix); glEnable(GL_MULTISAMPLE); @@ -527,7 +526,8 @@ void viveRenderTo(void* headset, headsetRenderCallback callback, void* userdata) glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); uintptr_t texture = (uintptr_t) vive->resolveTexture; - Texture_t eyeTexture = { (void*) texture, graphicsConvention, EColorSpace_ColorSpace_Gamma }; + ETextureType textureType = ETextureType_TextureType_OpenGL; + Texture_t eyeTexture = { (void*) texture, textureType, EColorSpace_ColorSpace_Gamma }; EVRSubmitFlags flags = EVRSubmitFlags_Submit_Default; vive->compositor->Submit(eye, &eyeTexture, NULL, flags); }