From a4f9187b9b06ef3babb7659bf563b809a328e6e5 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Sun, 1 Sep 2019 23:04:06 +0200 Subject: fix bug with vsync checkbox --- src/libui_sdl/DlgVideoSettings.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libui_sdl/DlgVideoSettings.cpp b/src/libui_sdl/DlgVideoSettings.cpp index 155fe8b..afa7357 100644 --- a/src/libui_sdl/DlgVideoSettings.cpp +++ b/src/libui_sdl/DlgVideoSettings.cpp @@ -137,6 +137,10 @@ void OnRendererChanged(uiRadioButtons* rb, void* blarg) UpdateControls(); bool new_usegl = (Config::ScreenUseGL != 0) || (Config::_3DRenderer != 0); + + if (new_usegl) uiControlEnable(uiControl(cbVSync)); + else uiControlDisable(uiControl(cbVSync)); + if (new_usegl != old_usegl) ApplyNewSettings(2); else @@ -332,8 +336,10 @@ void Open() uiRadioButtonsSetSelected(rbRenderer, Config::_3DRenderer); UpdateControls(); - if (Config::ScreenUseGL) uiControlEnable(uiControl(cbVSync)); - else uiControlDisable(uiControl(cbVSync)); + if (Config::ScreenUseGL || Config::_3DRenderer != 0) + uiControlEnable(uiControl(cbVSync)); + else + uiControlDisable(uiControl(cbVSync)); uiControlShow(uiControl(win)); } -- cgit v1.2.3