mirror of
https://github.com/lubosz/overte.git
synced 2025-04-19 12:24:01 +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 {
|
||||
#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
|
||||
return false;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue