mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:03:35 +02:00
Fixing crash in vive controllers
This commit is contained in:
parent
6ce4820b9f
commit
0ff283d09e
1 changed files with 8 additions and 1 deletions
|
@ -65,7 +65,14 @@ ViveControllerManager::ViveControllerManager() :
|
||||||
|
|
||||||
bool ViveControllerManager::isSupported() const {
|
bool ViveControllerManager::isSupported() const {
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
return vr::VR_IsHmdPresent();
|
bool success = vr::VR_IsHmdPresent();
|
||||||
|
if (success) {
|
||||||
|
vr::HmdError eError = vr::HmdError_None;
|
||||||
|
auto hmd = vr::VR_Init(&eError);
|
||||||
|
success = (hmd != nullptr);
|
||||||
|
vr::VR_Shutdown();
|
||||||
|
}
|
||||||
|
return success;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue