mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 22:09:02 +02:00
Don't allow leaving VR mode to target the rift
This commit is contained in:
parent
ac0ec0a458
commit
f3e701e0d5
2 changed files with 12 additions and 2 deletions
|
@ -197,6 +197,13 @@ void HMDToolsDialog::centerCursorOnWidget(QWidget* widget) {
|
||||||
void HMDToolsDialog::showEvent(QShowEvent* event) {
|
void HMDToolsDialog::showEvent(QShowEvent* event) {
|
||||||
// center the cursor on the hmd tools dialog
|
// center the cursor on the hmd tools dialog
|
||||||
centerCursorOnWidget(this);
|
centerCursorOnWidget(this);
|
||||||
|
if (qApp->isHMDMode()) {
|
||||||
|
_inHDMMode = true;
|
||||||
|
_switchModeButton->setText("Leave HMD Mode");
|
||||||
|
} else {
|
||||||
|
_inHDMMode = false;
|
||||||
|
_switchModeButton->setText("Enter HMD Mode");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HMDToolsDialog::hideEvent(QHideEvent* event) {
|
void HMDToolsDialog::hideEvent(QHideEvent* event) {
|
||||||
|
|
|
@ -116,7 +116,11 @@ void Oculus_0_5_DisplayPlugin::deactivate(PluginContainer* container) {
|
||||||
|
|
||||||
OculusBaseDisplayPlugin::deactivate(container);
|
OculusBaseDisplayPlugin::deactivate(container);
|
||||||
|
|
||||||
container->unsetFullscreen();
|
QScreen* riftScreen = nullptr;
|
||||||
|
if (_hmdScreen >= 0) {
|
||||||
|
riftScreen = qApp->screens()[_hmdScreen];
|
||||||
|
}
|
||||||
|
container->unsetFullscreen(riftScreen);
|
||||||
|
|
||||||
ovrHmd_Destroy(_hmd);
|
ovrHmd_Destroy(_hmd);
|
||||||
_hmd = nullptr;
|
_hmd = nullptr;
|
||||||
|
@ -140,7 +144,6 @@ void Oculus_0_5_DisplayPlugin::display(GLuint finalTexture, const glm::uvec2& sc
|
||||||
ovrHmd_EndFrame(_hmd, _eyePoses, _eyeTextures);
|
ovrHmd_EndFrame(_hmd, _eyePoses, _eyeTextures);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _hswDismissed{false};
|
|
||||||
// Pass input events on to the application
|
// Pass input events on to the application
|
||||||
bool Oculus_0_5_DisplayPlugin::eventFilter(QObject* receiver, QEvent* event) {
|
bool Oculus_0_5_DisplayPlugin::eventFilter(QObject* receiver, QEvent* event) {
|
||||||
if (!_hswDismissed && (event->type() == QEvent::KeyPress)) {
|
if (!_hswDismissed && (event->type() == QEvent::KeyPress)) {
|
||||||
|
|
Loading…
Reference in a new issue