Actually toggle vsync instead of re-initialising the entire thing again

This commit is contained in:
Matt authored and GitHub committed 2024-08-11 09:54:40 +02:00
1 parent 07f54c22bd
commit bbba91de78
1 file changed
+4
@@ -76,11 +76,15 @@ public:
if (_useVsync != vsync)
{
_useVsync = vsync;
#if SDL_VERSION_ATLEAST(2, 0, 18)
SDL_RenderSetVSync(_sdlRenderer, vsync ? 1 : 0);
#else
SDL_DestroyRenderer(_sdlRenderer);
_screenTexture = nullptr;
_scaledScreenTexture = nullptr;
Initialise();
Resize(_uiContext->GetWidth(), _uiContext->GetHeight());
#endif
}
}