mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 14:13:47 +02:00
Fixed build errors when libovr is not present
This commit is contained in:
parent
5a2d2bba8f
commit
e51eb34f05
2 changed files with 12 additions and 7 deletions
|
@ -20,6 +20,8 @@
|
|||
|
||||
#include "Application.h"
|
||||
|
||||
#ifdef HAVE_LIBOVR
|
||||
|
||||
using namespace OVR;
|
||||
|
||||
ProgramObject OculusManager::_program;
|
||||
|
@ -35,8 +37,6 @@ int OculusManager::_texCoord1AttributeLocation;
|
|||
int OculusManager::_texCoord2AttributeLocation;
|
||||
bool OculusManager::_isConnected = false;
|
||||
|
||||
#ifdef HAVE_LIBOVR
|
||||
|
||||
ovrHmd OculusManager::_ovrHmd;
|
||||
ovrHmdDesc OculusManager::_ovrHmdDesc;
|
||||
ovrFovPort OculusManager::_eyeFov[ovrEye_Count];
|
||||
|
@ -127,6 +127,7 @@ void OculusManager::connect() {
|
|||
|
||||
//Disconnects and deallocates the OR
|
||||
void OculusManager::disconnect() {
|
||||
#ifdef HAVE_LIBOVR
|
||||
if (_isConnected) {
|
||||
_isConnected = false;
|
||||
ovrHmd_Destroy(_ovrHmd);
|
||||
|
@ -144,10 +145,12 @@ void OculusManager::disconnect() {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OculusManager::generateDistortionMesh() {
|
||||
#ifdef HAVE_LIBOVR
|
||||
void OculusManager::generateDistortionMesh() {
|
||||
|
||||
//Check if we already have the distortion mesh
|
||||
if (_vertices[0] != 0) {
|
||||
printf("WARNING: Tried to generate Oculus distortion mesh twice without freeing the VBOs.");
|
||||
|
@ -206,8 +209,9 @@ void OculusManager::generateDistortionMesh() {
|
|||
OVR_FREE(pVBVerts);
|
||||
ovrHmd_DestroyDistortionMesh(&meshData);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
bool OculusManager::isConnected() {
|
||||
#ifdef HAVE_LIBOVR
|
||||
|
@ -347,6 +351,7 @@ void OculusManager::display(const glm::quat &bodyOrientation, const glm::vec3 &p
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBOVR
|
||||
void OculusManager::renderDistortionMesh(ovrPosef eyeRenderPose[ovrEye_Count]) {
|
||||
|
||||
glLoadIdentity();
|
||||
|
@ -409,6 +414,7 @@ void OculusManager::renderDistortionMesh(ovrPosef eyeRenderPose[ovrEye_Count]) {
|
|||
_program.release();
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
//Tries to reconnect to the sensors
|
||||
void OculusManager::reset() {
|
||||
|
|
|
@ -15,9 +15,8 @@
|
|||
|
||||
#ifdef HAVE_LIBOVR
|
||||
#include <OVR.h>
|
||||
#endif
|
||||
|
||||
#include "../src/Util/Util_Render_Stereo.h"
|
||||
#endif
|
||||
|
||||
#include "renderer/ProgramObject.h"
|
||||
|
||||
|
@ -44,6 +43,7 @@ public:
|
|||
static QSize getRenderTargetSize();
|
||||
|
||||
private:
|
||||
#ifdef HAVE_LIBOVR
|
||||
static void generateDistortionMesh();
|
||||
static void renderDistortionMesh(ovrPosef eyeRenderPose[ovrEye_Count]);
|
||||
|
||||
|
@ -76,7 +76,6 @@ private:
|
|||
|
||||
static bool _isConnected;
|
||||
|
||||
#ifdef HAVE_LIBOVR
|
||||
static ovrHmd _ovrHmd;
|
||||
static ovrHmdDesc _ovrHmdDesc;
|
||||
static ovrFovPort _eyeFov[ovrEye_Count];
|
||||
|
|
Loading…
Reference in a new issue