From 37fa087c2ea86b26d4f5f36bdcaf572725072363 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Tue, 12 Jan 2021 14:18:33 +0100 Subject: [PATCH] prevent jerkiness when creating window in fullscreen mode --- BBGE/Window_SDL2.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BBGE/Window_SDL2.cpp b/BBGE/Window_SDL2.cpp index ac1027c..6f5f764 100644 --- a/BBGE/Window_SDL2.cpp +++ b/BBGE/Window_SDL2.cpp @@ -105,7 +105,10 @@ void Window::_open(unsigned w, unsigned h, bool full, unsigned bpp, bool vsync, exit_error("Failed to create GL context"); SDL_GL_MakeCurrent(WIN, GLCTX); - _adjust(w, h, full, bpp, vsync, display, hz); + setvsync(vsync); + + if(!full) // When we're in fullscreen mode everything is fine by now + _adjust(w, h, full, bpp, vsync, display, hz); } void Window::_adjust(unsigned w, unsigned h, bool full, unsigned bpp, bool vsync, unsigned display, unsigned hz)