mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:18:24 +02:00
shutdown when oculus display lost
This commit is contained in:
parent
799db33b34
commit
83fba2ee41
3 changed files with 6 additions and 1 deletions
|
@ -30,7 +30,7 @@ bool OculusBaseDisplayPlugin::beginFrameRender(uint32_t frameIndex) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ovr::quitRequested(status) || !ovr::handleOVREvents()) {
|
if (ovr::quitRequested(status) || ovr::displayLost(status) || !ovr::handleOVREvents()) {
|
||||||
QMetaObject::invokeMethod(qApp, "quit");
|
QMetaObject::invokeMethod(qApp, "quit");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,6 +195,10 @@ void OculusDisplayPlugin::hmdPresent() {
|
||||||
|
|
||||||
if (!OVR_SUCCESS(result)) {
|
if (!OVR_SUCCESS(result)) {
|
||||||
qWarning(oculusLog) << "Failed to present" << ovr::getError();
|
qWarning(oculusLog) << "Failed to present" << ovr::getError();
|
||||||
|
if (result == ovrError_DisplayLost) {
|
||||||
|
qWarning(oculusLog) << "Display lost, shutting down";
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int compositorDroppedFrames = 0;
|
static int compositorDroppedFrames = 0;
|
||||||
|
|
|
@ -38,6 +38,7 @@ struct ovr {
|
||||||
static inline bool hasInputFocus() { return hasInputFocus(getStatus()); }
|
static inline bool hasInputFocus() { return hasInputFocus(getStatus()); }
|
||||||
|
|
||||||
static inline bool quitRequested(const ovrSessionStatus& status) { return status.ShouldQuit != ovrFalse; }
|
static inline bool quitRequested(const ovrSessionStatus& status) { return status.ShouldQuit != ovrFalse; }
|
||||||
|
static inline bool displayLost(const ovrSessionStatus& status) { return status.DisplayLost != ovrFalse; }
|
||||||
static inline bool reorientRequested(const ovrSessionStatus& status) { return status.ShouldRecenter != ovrFalse; }
|
static inline bool reorientRequested(const ovrSessionStatus& status) { return status.ShouldRecenter != ovrFalse; }
|
||||||
static inline bool hmdMounted(const ovrSessionStatus& status) { return status.HmdMounted != ovrFalse; }
|
static inline bool hmdMounted(const ovrSessionStatus& status) { return status.HmdMounted != ovrFalse; }
|
||||||
static inline bool hasInputFocus(const ovrSessionStatus& status) { return status.HasInputFocus != ovrFalse; }
|
static inline bool hasInputFocus(const ovrSessionStatus& status) { return status.HasInputFocus != ovrFalse; }
|
||||||
|
|
Loading…
Reference in a new issue