History

Fixing crash in vive controllers

Brad Davis committed 11 years ago

Commit 0ff283d1 parent 6ce48201 file · +8 −1Browse files

Showing the changes to libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp (1 of 1 file). Show all

Unified · Split

libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp+8−1
@@ -65,7 +65,14 @@ ViveControllerManager::ViveControllerManager() : · 64 unmodified lines
6565
6666 bool ViveControllerManager::isSupported() const {
6767 #ifdef Q_OS_WIN
68− return vr::VR_IsHmdPresent();
68+ bool success = vr::VR_IsHmdPresent();
69+ if (success) {
70+ vr::HmdError eError = vr::HmdError_None;
71+ auto hmd = vr::VR_Init(&eError);
72+ success = (hmd != nullptr);
73+ vr::VR_Shutdown();
74+ }
75+ return success;
6976 #else
7077 return false;
7178 #endif