Maybe avoid gcc compile problem with forward declared enum.

This commit is contained in:
Christopher Bruns 2017-05-27 20:16:00 -04:00
parent c1bacdbf92
commit a149b54226
2 changed files with 6 additions and 7 deletions

View file

@ -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;
}

View file

@ -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;