1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

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.
This commit is contained in:
Misa 2023-09-09 20:04:04 -07:00
parent 1bf0d11c9e
commit 8de93cb0f4

View file

@ -39,12 +39,6 @@ void Screen::init(const struct ScreenSettings* settings)
badSignalEffect = settings->badSignal; badSignalEffect = settings->badSignal;
vsync = settings->useVsync; 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 // Uncomment this next line when you need to debug -flibit
// SDL_SetHintWithPriority(SDL_HINT_RENDER_DRIVER, "software", SDL_HINT_OVERRIDE); // SDL_SetHintWithPriority(SDL_HINT_RENDER_DRIVER, "software", SDL_HINT_OVERRIDE);
@ -71,6 +65,8 @@ void Screen::init(const struct ScreenSettings* settings)
VVV_exit(1); VVV_exit(1);
} }
SDL_RenderSetVSync(m_renderer, (int) vsync);
#ifdef INTERIM_VERSION_EXISTS #ifdef INTERIM_VERSION_EXISTS
/* Branch name limits are ill-defined but on GitHub it's ~256 chars /* Branch name limits are ill-defined but on GitHub it's ~256 chars
* ( https://stackoverflow.com/a/24014513/ ). * ( https://stackoverflow.com/a/24014513/ ).