History

OpenVr: fix for conflict between openvr and oculus display plugins

* Call vr::VR_Shutdown() when ref-count goes to zero. The ref-count is ncessary because the vr::IVRSystem poitner is shared between the the openvr input and display plugins. * OpenVR plugins options will display in the menu if vr::VR_IsHmdPresent() is true. This is faster then initializing all of openvr and less likely to conflict with the oculus display plugin.

Anthony J. Thibault committed 10 years ago

Commit c8e6aee1 parent 90f08214 files · +6 −27Browse files

Showing the changes to plugins/oculus/src/OculusBaseDisplayPlugin.cpp (1 of 4 files). Show all

Unified · Split

plugins/oculus/src/OculusBaseDisplayPlugin.cpp+2−0
@@ -39,6 +39,7 @@ glm::mat4 OculusBaseDisplayPlugin::getHeadPose(uint32_t frameIndex) const { · 38 unmodified lines
3939
4040 bool OculusBaseDisplayPlugin::isSupported() const {
4141 if (!OVR_SUCCESS(ovr_Initialize(nullptr))) {
42+ qDebug() << "OculusBaseDisplayPlugin : ovr_Initialize() failed";
4243 return false;
4344 }
4445
@@ -48,6 +49,7 @@ bool OculusBaseDisplayPlugin::isSupported() const { · 3 unmodified lines
4849 if (!OVR_SUCCESS(result)) {
4950 ovrErrorInfo error;
5051 ovr_GetLastErrorInfo(&error);
52+ qDebug() << "OculusBaseDisplayPlugin : ovr_Create() failed" << result << error.Result << error.ErrorString;
5153 ovr_Shutdown();
5254 return false;
5355 }