From e76a68666a38cbe85850d67787087c427fe8789a Mon Sep 17 00:00:00 2001 From: Lubos Date: Sun, 14 Aug 2022 12:02:51 +0200 Subject: [PATCH] OpenXR - Config for stereoscopic vision added --- Common/GPU/OpenGL/GLRenderManager.cpp | 2 +- Core/Config.cpp | 1 + Core/Config.h | 1 + UI/GameSettingsScreen.cpp | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Common/GPU/OpenGL/GLRenderManager.cpp b/Common/GPU/OpenGL/GLRenderManager.cpp index b1c60dbd22..07748d7742 100644 --- a/Common/GPU/OpenGL/GLRenderManager.cpp +++ b/Common/GPU/OpenGL/GLRenderManager.cpp @@ -209,7 +209,7 @@ bool GLRenderManager::ThreadFrame() { // Decide if the scene is 3D or not if (g_Config.bEnableVR && (VR_GetConfig(VR_CONFIG_3D_GEOMETRY_COUNT) > 15)) { - VR_SetConfig(VR_CONFIG_MODE, VR_MODE_MONO_6DOF); + VR_SetConfig(VR_CONFIG_MODE, g_Config.bEnableStereo ? VR_MODE_STEREO_6DOF : VR_MODE_MONO_6DOF); } else { VR_SetConfig(VR_CONFIG_MODE, VR_MODE_FLAT_SCREEN); } diff --git a/Core/Config.cpp b/Core/Config.cpp index 580f8cd820..bde8ff9b86 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1208,6 +1208,7 @@ static ConfigSetting themeSettings[] = { static ConfigSetting vrSettings[] = { ConfigSetting("VREnable", &g_Config.bEnableVR, true), ConfigSetting("VREnable6DoF", &g_Config.bEnable6DoF, true), + ConfigSetting("VREnableStereo", &g_Config.bEnableStereo, true), ConfigSetting("VRFieldOfView", &g_Config.iFieldOfViewPercentage, 100), }; diff --git a/Core/Config.h b/Core/Config.h index cdb0bbfff2..35e8931904 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -456,6 +456,7 @@ public: // Virtual reality bool bEnableVR; bool bEnable6DoF; + bool bEnableStereo; int iFieldOfViewPercentage; // Debugger diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 27b6217155..0b51d6edf9 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1117,6 +1117,8 @@ void GameSettingsScreen::CreateViews() { vrSettings->Add(new CheckBox(&g_Config.bEnableVR, vr->T("Enable virtual reality"))); CheckBox *vr6DoF = vrSettings->Add(new CheckBox(&g_Config.bEnable6DoF, vr->T("Enable 6 degrees of freedom movement"))); vr6DoF->SetEnabledPtr(&g_Config.bEnableVR); + CheckBox *vrStereo = vrSettings->Add(new CheckBox(&g_Config.bEnableStereo, vr->T("Enable stereoscopic vision"))); + vrStereo->SetEnabledPtr(&g_Config.bEnableVR); PopupSliderChoice *vrFieldOfView = vrSettings->Add(new PopupSliderChoice(&g_Config.iFieldOfViewPercentage, 100, 150, vr->T("Field of view scale", "Headset's field of view scale"), 10, screenManager(), vr->T("% of native FoV"))); vrFieldOfView->SetEnabledPtr(&g_Config.bEnableVR); }