From 20b527f2ab1019e847daa3d3b4abb3a95d77fba5 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Sun, 6 Oct 2024 17:08:35 -0300 Subject: [PATCH] Fix compile errors when SDL2 is used --- src/modules/window/sdl/Window.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/window/sdl/Window.cpp b/src/modules/window/sdl/Window.cpp index 430306f9d..2ee847a77 100644 --- a/src/modules/window/sdl/Window.cpp +++ b/src/modules/window/sdl/Window.cpp @@ -666,10 +666,18 @@ bool Window::setWindow(int width, int height, WindowSettings *settings) SDL_SetWindowSize(window, width, height); if (this->settings.resizable != f.resizable) +#if SDL_VERSION_ATLEAST(3, 0, 0) SDL_SetWindowResizable(window, f.resizable); +#else + SDL_SetWindowResizable(window, f.resizable ? SDL_TRUE : SDL_FALSE); +#endif if (this->settings.borderless != f.borderless) - SDL_SetWindowBordered(window, f.borderless); +#if SDL_VERSION_ATLEAST(3, 0, 0) + SDL_SetWindowBordered(window, !f.borderless); +#else + SDL_SetWindowBordered(window, f.borderless ? SDL_FALSE : SDL_TRUE); +#endif } else {