Fixing crash in vive controllers

This commit is contained in:
Brad Davis 2015-08-12 12:24:53 -07:00
parent 6ce4820b9f
commit 0ff283d09e

View file

@ -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