From a149b542260aa1e9347c8fd2d8805033042fefb7 Mon Sep 17 00:00:00 2001 From: Christopher Bruns Date: Sat, 27 May 2017 20:16:00 -0400 Subject: [PATCH] Maybe avoid gcc compile problem with forward declared enum. --- src/gl/stereo3d/gl_openvr.cpp | 8 ++++---- src/gl/stereo3d/gl_openvr.h | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gl/stereo3d/gl_openvr.cpp b/src/gl/stereo3d/gl_openvr.cpp index 7193de0ce..bd0aecdc9 100644 --- a/src/gl/stereo3d/gl_openvr.cpp +++ b/src/gl/stereo3d/gl_openvr.cpp @@ -140,7 +140,7 @@ static HmdVector3d_t eulerAnglesFromMatrix(HmdMatrix34_t mat) { return eulerAnglesFromQuat(quatFromMatrix(mat)); } -OpenVREyePose::OpenVREyePose(vr::EVREye eye) +OpenVREyePose::OpenVREyePose(int eye) : ShiftedEyePose( 0.0f ) , eye(eye) , eyeTexture(nullptr) @@ -254,7 +254,7 @@ void OpenVREyePose::initialize(vr::IVRSystem& vrsystem) float zNear = 5.0; float zFar = 65536.0; vr::HmdMatrix44_t projection = vrsystem.GetProjectionMatrix( - eye, zNear, zFar); + vr::EVREye(eye), zNear, zFar); vr::HmdMatrix44_t proj_transpose; for (int i = 0; i < 4; ++i) { for (int j = 0; j < 4; ++j) { @@ -264,7 +264,7 @@ void OpenVREyePose::initialize(vr::IVRSystem& vrsystem) projectionMatrix.loadIdentity(); projectionMatrix.multMatrix(&proj_transpose.m[0][0]); - vr::HmdMatrix34_t eyeToHead = vrsystem.GetEyeToHeadTransform(eye); + vr::HmdMatrix34_t eyeToHead = vrsystem.GetEyeToHeadTransform(vr::EVREye(eye)); vSMatrixFromHmdMatrix34(eyeToHeadTransform, eyeToHead); vr::HmdMatrix34_t otherEyeToHead = vrsystem.GetEyeToHeadTransform(eye == Eye_Left ? Eye_Right : Eye_Left); vSMatrixFromHmdMatrix34(otherEyeToHeadTransform, otherEyeToHead); @@ -291,7 +291,7 @@ bool OpenVREyePose::submitFrame() const if (vr::VRCompositor() == nullptr) return false; eyeTexture->handle = (void *)GLRenderer->mBuffers->GetEyeTextureGLHandle((int)eye); - vr::VRCompositor()->Submit(eye, eyeTexture); + vr::VRCompositor()->Submit(vr::EVREye(eye), eyeTexture); return true; } diff --git a/src/gl/stereo3d/gl_openvr.h b/src/gl/stereo3d/gl_openvr.h index 352be6b7b..9fc905207 100644 --- a/src/gl/stereo3d/gl_openvr.h +++ b/src/gl/stereo3d/gl_openvr.h @@ -45,7 +45,6 @@ namespace vr { struct HmdMatrix44_t; struct Texture_t; struct TrackedDevicePose_t; - enum EVREye; } /* stereoscopic 3D API */ @@ -54,7 +53,7 @@ namespace s3d { class OpenVREyePose : public ShiftedEyePose { public: - OpenVREyePose(vr::EVREye eye); + OpenVREyePose(int eye); virtual ~OpenVREyePose() override; virtual VSMatrix GetProjection(FLOATTYPE fov, FLOATTYPE aspectRatio, FLOATTYPE fovRatio) const override; virtual void GetViewShift(float yaw, float outViewShift[3]) const override; @@ -69,7 +68,7 @@ protected: VSMatrix eyeToHeadTransform; VSMatrix otherEyeToHeadTransform; vr::Texture_t* eyeTexture; - vr::EVREye eye; + int eye; // TODO: adjust doomUnitsPerMeter according to player height float verticalDoomUnitsPerMeter;