diff --git a/src/headset/headset.h b/src/headset/headset.h index 56ac5d71..30a0c71b 100644 --- a/src/headset/headset.h +++ b/src/headset/headset.h @@ -3,8 +3,6 @@ #pragma once -typedef void (*headsetRenderCallback)(int eyeIndex, void* userdata); - typedef enum { EYE_LEFT, EYE_RIGHT @@ -34,6 +32,7 @@ typedef struct { } Controller; typedef vec_t(Controller*) vec_controller_t; +typedef void (*headsetRenderCallback)(HeadsetEye eye, void* userdata); typedef struct { void (*destroy)(void* headset); diff --git a/src/headset/vive.c b/src/headset/vive.c index 5f3bce1e..7ab04735 100644 --- a/src/headset/vive.c +++ b/src/headset/vive.c @@ -499,7 +499,7 @@ void viveRenderTo(void* headset, headsetRenderCallback callback, void* userdata) mat4_multiply(transform, head); // Projection - matrix = vive->system->GetProjectionMatrix(eye, vive->clipNear, vive->clipFar).m; + matrix = vive->system->GetProjectionMatrix(vrEye, vive->clipNear, vive->clipFar).m; mat4_fromMat44(projection, matrix); // Render @@ -518,7 +518,7 @@ void viveRenderTo(void* headset, headsetRenderCallback callback, void* userdata) 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); + vive->compositor->Submit(vrEye, &eyeTexture, NULL, flags); } vive->isRendering = 0;