Showing the changes to plugins/oculus/src/OculusBaseDisplayPlugin.cpp (1 of 3 files). Show all
Unified · Split
| @@ -23,13 +23,14 @@ void OculusBaseDisplayPlugin::resetSensors() { · 22 unmodified lines | ||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | bool OculusBaseDisplayPlugin::beginFrameRender(uint32_t frameIndex) { |
| 26 | − ovrSessionStatus status{}; | |
| 27 | − if (!OVR_SUCCESS(ovr_GetSessionStatus(_session, &status))) { | |
| 26 | + ovrResult getStatusResult; | |
| 27 | + ovrSessionStatus status = ovr::getStatus(getStatusResult); | |
| 28 | + if (!OVR_SUCCESS(getStatusResult)) { | |
| 28 | 29 | qCWarning(oculusLog) << "Unable to fetch Oculus session status" << ovr::getError(); |
| 29 | 30 | return false; |
| 30 | 31 | } |
| 31 | 32 | |
| 32 | − if (ovr::quitRequested(status)) { | |
| 33 | + if (ovr::quitRequested(status) || !ovr::handleOVREvents()) { | |
| 33 | 34 | QMetaObject::invokeMethod(qApp, "quit"); |
| 34 | 35 | return false; |
| 35 | 36 | } |
| @@ -44,7 +45,7 @@ bool OculusBaseDisplayPlugin::beginFrameRender(uint32_t frameIndex) { · 8 unmodified lines | ||
| 44 | 45 | _currentRenderFrameInfo = FrameInfo(); |
| 45 | 46 | _currentRenderFrameInfo.sensorSampleTime = ovr_GetTimeInSeconds(); |
| 46 | 47 | _currentRenderFrameInfo.predictedDisplayTime = ovr_GetPredictedDisplayTime(_session, frameIndex); |
| 47 | − auto trackingState = ovr_GetTrackingState(_session, _currentRenderFrameInfo.predictedDisplayTime, ovrTrue); | |
| 48 | + auto trackingState = ovr::getTrackingState(_currentRenderFrameInfo.predictedDisplayTime, ovrTrue); | |
| 48 | 49 | _currentRenderFrameInfo.renderPose = ovr::toGlm(trackingState.HeadPose.ThePose); |
| 49 | 50 | _currentRenderFrameInfo.presentPose = _currentRenderFrameInfo.renderPose; |
| 50 | 51 | |
| @@ -167,7 +168,7 @@ void OculusBaseDisplayPlugin::updatePresentPose() { · 116 unmodified lines | ||
| 167 | 168 | ovrTrackingState trackingState; |
| 168 | 169 | _currentPresentFrameInfo.sensorSampleTime = ovr_GetTimeInSeconds(); |
| 169 | 170 | _currentPresentFrameInfo.predictedDisplayTime = ovr_GetPredictedDisplayTime(_session, 0); |
| 170 | − trackingState = ovr_GetTrackingState(_session, _currentRenderFrameInfo.predictedDisplayTime, ovrFalse); | |
| 171 | + trackingState = ovr::getTrackingState(_currentRenderFrameInfo.predictedDisplayTime); | |
| 171 | 172 | _currentPresentFrameInfo.presentPose = ovr::toGlm(trackingState.HeadPose.ThePose); |
| 172 | 173 | _currentPresentFrameInfo.renderPose = _currentPresentFrameInfo.presentPose; |
| 173 | 174 | } |