Fix VSync renderer workaround

SDL just got an API to toggle VSync without having to tear down the
renderer ( libsdl-org/SDL#4157 ). We can remove the workaround and use
that instead. For now, we are putting it behind an ifdef until SDL
2.0.18 officially releases in November.

Fixes #831.
This commit is contained in:
Misa
2021-09-14 20:23:22 -07:00
parent 8d0a90a588
commit 6ba7058a0e
4 changed files with 14 additions and 49 deletions

View File

@@ -370,10 +370,12 @@ static void menurender(void)
break;
case 5:
graphics.bigprint(-1, 30, "Toggle VSync", tr, tg, tb, true);
#ifdef __HAIKU__ // FIXME: Remove after SDL VSync bug is fixed! -flibit
graphics.Print(-1, 65, "Edit the config file on Haiku!", tr, tg, tb, true);
#else
/* FIXME: Upgrade to SDL 2.0.18 and remove this ifdef when it releases! */
#if SDL_VERSION_ATLEAST(2, 0, 17)
graphics.Print(-1, 65, "Turn VSync on or off.", tr, tg, tb, true);
#else
graphics.Print(-1, 65, "Your SDL version is too old!", tr, tg, tb, true);
graphics.Print(-1, 75, "Edit the config file.", tr, tg, tb, true);
#endif
if (!graphics.screenbuffer->vsync)