mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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;
|
||||
}
|
||||
|
||||
if (ovr::quitRequested(status) || !ovr::handleOVREvents()) {
|
||||
if (ovr::quitRequested(status) || ovr::displayLost(status) || !ovr::handleOVREvents()) {
|
||||
QMetaObject::invokeMethod(qApp, "quit");
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -195,6 +195,10 @@ void OculusDisplayPlugin::hmdPresent() {
|
|||
|
||||
if (!OVR_SUCCESS(result)) {
|
||||
qWarning(oculusLog) << "Failed to present" << ovr::getError();
|
||||
if (result == ovrError_DisplayLost) {
|
||||
qWarning(oculusLog) << "Display lost, shutting down";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static int compositorDroppedFrames = 0;
|
||||
|
|
|
@ -38,6 +38,7 @@ struct ovr {
|
|||
static inline bool hasInputFocus() { return hasInputFocus(getStatus()); }
|
||||
|
||||
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 hmdMounted(const ovrSessionStatus& status) { return status.HmdMounted != ovrFalse; }
|
||||
static inline bool hasInputFocus(const ovrSessionStatus& status) { return status.HasInputFocus != ovrFalse; }
|
||||
|
|
Loading…
Reference in a new issue