mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 14:12:50 +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;
|
||||
|
||||
protected:
|
||||
ovrSession _session;
|
||||
ovrSession _session { nullptr };
|
||||
ovrGraphicsLuid _luid;
|
||||
ovrEyeRenderDesc _eyeRenderDescs[2];
|
||||
ovrFovPort _eyeFovs[2];
|
||||
|
|
|
@ -42,7 +42,6 @@ private:
|
|||
friend class OculusControllerManager;
|
||||
};
|
||||
|
||||
// Waiting on touch API
|
||||
class RemoteDevice : public OculusInputDevice {
|
||||
public:
|
||||
using Pointer = std::shared_ptr<RemoteDevice>;
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
#include "OculusHelpers.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include <QtCore/QLoggingCategory>
|
||||
#include <QtCore/QFile>
|
||||
|
||||
using Mutex = std::mutex;
|
||||
using Lock = std::unique_lock<Mutex>;
|
||||
|
@ -38,9 +40,21 @@ void logFatal(const char* what) {
|
|||
qFatal(error.c_str());
|
||||
}
|
||||
|
||||
static const QString GOOD_OCULUS_RUNTIME_FILE { "C:\\Program Files(x86)\\Oculus\\Support\\oculus - runtime\\LibOVRRT64_1.dll" };
|
||||
|
||||
bool oculusAvailable() {
|
||||
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() {
|
||||
|
|
Loading…
Reference in a new issue