Upgrade to SDL3#2039
Conversation
|
We had a PR with SDL3 update in 2024 (#1672). At that moment we were supporting platforms that weren't supporting SDL3, we actually had players that asked us to not update to SDL3, so I asked the author if we can support both SDL2 and SDL3, and it was decided to close the PR to keep the code clean. My opinion here is that we really should implement all kinds of prebuilt binaries (tracked in #1403), including e.g. AppImage, so that players won't need to build the engine themselves everytime and we won't need to hesitate the upgrades. |
|
It's none of my business. If I had the choice between SDL2 and SDL3, I'd stick with SDL2, specifically on Android. |
This pull request upgrades the project from SDL2 to SDL3. This is a major update that brings numerous improvements, new features, and ensures long-term support for the project's core platform and input layer.
Summary of Changes
The entire engine has been migrated to the new SDL3 API. This involved changes to window creation, event handling, input processing, and the rendering backend. The
imguilibrary has also been updated to use its new SDL3 backend.Detailed Changes
Build System
find_package(SDL3). The oldFindSDL*.cmakemodules have been removed or updated.Core Engine
<SDL.h>to<SDL3/SDL.h>.SDL_Init()andSDL_Quit()calls have been updated to reflect changes in SDL3's subsystem management.-1on error now returnfalse. All error handling code has been updated to check for boolean return values.SDL_ScancodeandSDL_Keycodeusage has been updated.SDL_GamepadAPI, replacing the deprecatedSDL_GameControllerAPI. This includes updated button and axis mappings.ImGui
imguibackend has been switched from the SDL2 implementation to the newimgui_impl_sdl3.cppbackend.imguirendering backend has been updated to work with the new SDL3 renderer implementations.How to Test