mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-13 22:27:13 +02:00
Don't crash on OpenVR activation when SteamVR isn't running
This commit is contained in:
parent
90b283f83b
commit
d4e83a7461
1 changed files with 12 additions and 3 deletions
|
@ -377,9 +377,6 @@ void OpenVrDisplayPlugin::init() {
|
|||
}
|
||||
|
||||
bool OpenVrDisplayPlugin::internalActivate() {
|
||||
_openVrDisplayActive = true;
|
||||
_container->setIsOptionChecked(StandingHMDSensorMode, true);
|
||||
|
||||
if (!_system) {
|
||||
_system = acquireOpenVrSystem();
|
||||
}
|
||||
|
@ -388,6 +385,18 @@ bool OpenVrDisplayPlugin::internalActivate() {
|
|||
return false;
|
||||
}
|
||||
|
||||
// If OpenVR isn't running, then the compositor won't be accessible
|
||||
// FIXME find a way to launch the compositor?
|
||||
if (!vr::VRCompositor()) {
|
||||
qWarning() << "Failed to acquire OpenVR compositor";
|
||||
releaseOpenVrSystem();
|
||||
_system = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
_openVrDisplayActive = true;
|
||||
_container->setIsOptionChecked(StandingHMDSensorMode, true);
|
||||
|
||||
_system->GetRecommendedRenderTargetSize(&_renderTargetSize.x, &_renderTargetSize.y);
|
||||
// Recommended render target size is per-eye, so double the X size for
|
||||
// left + right eyes
|
||||
|
|
Loading…
Reference in a new issue