History

Merge fixes, OSX compile fixes

Bradley Austin Davis committed 11 years ago

Commit 408bb081 parent 114ab9e8 files · +47 −19Browse files

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

Unified · Split

libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp+15−2
@@ -17,14 +17,16 @@ · 16 unmodified lines
1717 #include <gpu/Batch.h>
1818 #include <gpu/Context.h>
1919 #include <DeferredLightingEffect.h>
20−#include <display-plugins\openvr\OpenVrHelpers.h>
20+#include <display-plugins/openvr/OpenVrHelpers.h>
2121 #include "NumericalConstants.h"
2222 #include "UserActivityLogger.h"
2323
24+#ifndef Q_OS_MAC
2425 extern vr::IVRSystem* _hmd;
2526 extern int hmdRefCount;
2627 extern vr::TrackedDevicePose_t _trackedDevicePose[vr::k_unMaxTrackedDeviceCount];
2728 extern mat4 _trackedDevicePoseMat4[vr::k_unMaxTrackedDeviceCount];
29+#endif
2830
2931 const unsigned int LEFT_MASK = 0U;
3032 const unsigned int RIGHT_MASK = 1U;
@@ -55,10 +57,15 @@ ViveControllerManager::ViveControllerManager() : · 24 unmodified lines
5557 }
5658
5759 bool ViveControllerManager::isSupported() const {
60+#ifndef Q_OS_MAC
5861 return vr::VR_IsHmdPresent();
62+#else
63+ return false;
64+#endif
5965 }
6066
6167 void ViveControllerManager::activate(PluginContainer* container) {
68+#ifndef Q_OS_MAC
6269 hmdRefCount++;
6370 if (!_hmd) {
6471 vr::HmdError eError = vr::HmdError_None;
@@ -112,9 +119,11 @@ void ViveControllerManager::activate(PluginContainer* container) { · 47 unmodified lines
112119
113120 _modelLoaded = true;
114121 }
122+#endif
115123 }
116124
117125 void ViveControllerManager::deactivate() {
126+#ifndef Q_OS_MAC
118127 hmdRefCount--;
119128
120129 if (hmdRefCount == 0 && _hmd) {
@@ -122,6 +131,7 @@ void ViveControllerManager::deactivate() { · 1 unmodified line
122131 _hmd = nullptr;
123132 }
124133 _poseStateMap.clear();
134+#endif
125135 }
126136
127137 void ViveControllerManager::updateRendering(RenderArgs* args, render::ScenePointer scene, render::PendingChanges pendingChanges) {
@@ -187,12 +197,14 @@ void ViveControllerManager::renderHand(UserInputMapper::PoseValue pose, gpu::Bat · 59 unmodified lines
187197 }
188198
189199 void ViveControllerManager::update(float deltaTime, bool jointsCaptured) {
200+#ifndef Q_OS_MAC
190201 _poseStateMap.clear();
191202 // TODO: This shouldn't be necessary
192203 if (!_hmd) {
193204 return;
194205 }
195−
206+ return;
207+
196208 _buttonPressedMap.clear();
197209
198210 PerformanceTimer perfTimer("ViveControllerManager::update");
@@ -252,6 +264,7 @@ void ViveControllerManager::update(float deltaTime, bool jointsCaptured) { · 53 unmodified lines
252264 }
253265
254266 _trackedControllers = numTrackedControllers;
267+#endif
255268 }
256269
257270 void ViveControllerManager::focusOutEvent() {