From b197bfc964c0ef9a9788ce28e67da214b8067362 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 18 May 2018 00:12:45 +0200 Subject: [PATCH] - avoid checking for vr_enable_quadbuffered directly. This option only exists on Windows, so on the other platforms it should not be in the menu and not affect the setup of the VR mode. --- src/gl/stereo3d/gl_stereo_cvars.cpp | 2 +- src/v_video.h | 1 + src/win32/win32gliface.cpp | 1 + wadsrc/static/menudef.txt | 5 ++++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gl/stereo3d/gl_stereo_cvars.cpp b/src/gl/stereo3d/gl_stereo_cvars.cpp index 64a5b1b2e..c726ef4bb 100644 --- a/src/gl/stereo3d/gl_stereo_cvars.cpp +++ b/src/gl/stereo3d/gl_stereo_cvars.cpp @@ -88,7 +88,7 @@ const Stereo3DMode& Stereo3DMode::getCurrentMode() setCurrentMode(RightEyeView::getInstance(vr_ipd)); break; case 7: - if (vr_enable_quadbuffered) { + if (screen->enable_quadbuffered) { setCurrentMode(QuadStereo::getInstance(vr_ipd)); } else { diff --git a/src/v_video.h b/src/v_video.h index 57fc28945..93eda1263 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -349,6 +349,7 @@ protected: public: int hwcaps = 0; int instack[2] = { 0,0 }; // this is globally maintained state for portal recursion avoidance. + bool enable_quadbuffered = false; IntRect mScreenViewport; IntRect mSceneViewport; diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index c9589c263..875a1a78b 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -81,6 +81,7 @@ CUSTOM_CVAR(Bool, gl_debug, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINI CUSTOM_CVAR(Bool, vr_enable_quadbuffered, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) { Printf("You must restart " GAMENAME " to switch quad stereo mode\n"); + screen->enable_quadbuffered = self; } EXTERN_CVAR(Int, vid_refreshrate) diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index bafc85790..405526a38 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -2235,7 +2235,10 @@ OptionMenu "OpenGLOptions" protected Slider "$GLPREFMNU_MENUBLUR", gl_menu_blur, 0, 5.0, 0.5, 2 StaticText " " Option "$GLPREFMNU_VRMODE", vr_mode, "VRMode" - Option "$GLPREFMNU_VRQUADSTEREO", vr_enable_quadbuffered, "OnOff" + IfOption(Windows) + { + Option "$GLPREFMNU_VRQUADSTEREO", vr_enable_quadbuffered, "OnOff" + } StaticText " " Option "$GLPREFMNU_MULTISAMPLE", gl_multisample, "Multisample" Option "$GLPREFMNU_TONEMAP", gl_tonemap, "TonemapModes"