mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:18:38 +02:00
Only enable the Oculus plugin in the presence of the 1.x runtime
This commit is contained in:
parent
d056c41e25
commit
bd9813bbf5
3 changed files with 16 additions and 3 deletions
|
@ -28,7 +28,7 @@ protected:
|
||||||
void internalDeactivate() override;
|
void internalDeactivate() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ovrSession _session;
|
ovrSession _session { nullptr };
|
||||||
ovrGraphicsLuid _luid;
|
ovrGraphicsLuid _luid;
|
||||||
ovrEyeRenderDesc _eyeRenderDescs[2];
|
ovrEyeRenderDesc _eyeRenderDescs[2];
|
||||||
ovrFovPort _eyeFovs[2];
|
ovrFovPort _eyeFovs[2];
|
||||||
|
|
|
@ -42,7 +42,6 @@ private:
|
||||||
friend class OculusControllerManager;
|
friend class OculusControllerManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Waiting on touch API
|
|
||||||
class RemoteDevice : public OculusInputDevice {
|
class RemoteDevice : public OculusInputDevice {
|
||||||
public:
|
public:
|
||||||
using Pointer = std::shared_ptr<RemoteDevice>;
|
using Pointer = std::shared_ptr<RemoteDevice>;
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
#include "OculusHelpers.h"
|
#include "OculusHelpers.h"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
#include <QtCore/QLoggingCategory>
|
#include <QtCore/QLoggingCategory>
|
||||||
|
#include <QtCore/QFile>
|
||||||
|
|
||||||
using Mutex = std::mutex;
|
using Mutex = std::mutex;
|
||||||
using Lock = std::unique_lock<Mutex>;
|
using Lock = std::unique_lock<Mutex>;
|
||||||
|
@ -38,9 +40,21 @@ void logFatal(const char* what) {
|
||||||
qFatal(error.c_str());
|
qFatal(error.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const QString GOOD_OCULUS_RUNTIME_FILE { "C:\\Program Files(x86)\\Oculus\\Support\\oculus - runtime\\LibOVRRT64_1.dll" };
|
||||||
|
|
||||||
bool oculusAvailable() {
|
bool oculusAvailable() {
|
||||||
ovrDetectResult detect = ovr_Detect(0);
|
ovrDetectResult detect = ovr_Detect(0);
|
||||||
return (detect.IsOculusServiceRunning && detect.IsOculusHMDConnected);
|
if (!detect.IsOculusServiceRunning || !detect.IsOculusHMDConnected) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// HACK Explicitly check for the presence of the 1.0 runtime DLL, and fail if it
|
||||||
|
// doesn't exist
|
||||||
|
if (!QFile(GOOD_OCULUS_RUNTIME_FILE).exists()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ovrSession acquireOculusSession() {
|
ovrSession acquireOculusSession() {
|
||||||
|
|
Loading…
Reference in a new issue