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