From 8de93cb0f492fcd8540fe31ea647c32a1ba000cb Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 9 Sep 2023 20:04:04 -0700 Subject: [PATCH] Axe VSync hint in favor of SDL_RenderSetVSync Originally, we were using just the hint, but this didn't work well for toggling VSync (see #831). Then I added SDL_RenderSetVSync to SDL, and used that instead for toggling, but we were still setting the hint on game startup. Now, to keep things consistent, and just to make sure we don't get any surprising behavior should things change in the future, this makes it so game startup uses SDL_RenderSetVSync too. --- desktop_version/src/Screen.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/desktop_version/src/Screen.cpp b/desktop_version/src/Screen.cpp index 9d9ca56a..c24af1ed 100644 --- a/desktop_version/src/Screen.cpp +++ b/desktop_version/src/Screen.cpp @@ -39,12 +39,6 @@ void Screen::init(const struct ScreenSettings* settings) badSignalEffect = settings->badSignal; vsync = settings->useVsync; - SDL_SetHintWithPriority( - SDL_HINT_RENDER_VSYNC, - vsync ? "1" : "0", - SDL_HINT_OVERRIDE - ); - // Uncomment this next line when you need to debug -flibit // SDL_SetHintWithPriority(SDL_HINT_RENDER_DRIVER, "software", SDL_HINT_OVERRIDE); @@ -71,6 +65,8 @@ void Screen::init(const struct ScreenSettings* settings) VVV_exit(1); } + SDL_RenderSetVSync(m_renderer, (int) vsync); + #ifdef INTERIM_VERSION_EXISTS /* Branch name limits are ill-defined but on GitHub it's ~256 chars * ( https://stackoverflow.com/a/24014513/ ).