feat: add dual SDL2/SDL3 support with CMake option - #128
Closed
doncollins1985 wants to merge 1 commit into
Closed
Conversation
doncollins1985
commented
Jul 21, 2026
- Add USE_SDL CMake option (Auto/SDL2/SDL3) — prefers SDL3 when available
- All source files use #ifdef USE_SDL3 guards for API differences:
- Event type constants, key event struct access, modifier keys
- Window/drawable size functions, timer functions
- ImGui backend (sdl2 vs sdl3), GLSL version (150 vs 300 es)
- Audio capture API (callback vs polling)
- OpenGL proc loader for projectM (SDL3 requires explicit loader)
- Drop file event handling
- New cmake/SDL3Target.cmake for SDL3 target verification
- Updated ImGui.cmake for conditional SDL2/SDL3 backend and demo
- Updated dependencies_check.cmake for version-specific checks
- Updated packaging-linux.cmake for SDL-appropriate DEB depends
- Updated CI buildcheck to test both SDL2 and SDL3 on Linux
- Refactored drop file handler into separate HandleDropFile method
- Added audio device hotplug support for SDL3
- Added CurrentAudioLevel() and RefreshDeviceList() to AudioCapture
- Kept ImGui demo application target (ImGuiDemo)
- Add USE_SDL CMake option (Auto/SDL2/SDL3) — prefers SDL3 when available - All source files use #ifdef USE_SDL3 guards for API differences: Event types, key struct members, modifier keys, timer/window functions, ImGui backend (sdl2/sdl3), GLSL version (150/300 es), audio capture API, OpenGL proc loader, drop file handling - Conditional SDL linkage: SDL3::SDL3 vs SDL2::SDL2 + SDL2::SDL2main - New cmake/SDL3Target.cmake for SDL3 target verification - Updated ImGui.cmake for conditional backend and kept ImGuiDemo target - Updated dependencies_check.cmake and packaging-linux.cmake for SDL version - Added audio device hotplug support for SDL3 - Added CurrentAudioLevel() and RefreshDeviceList() to AudioCapture - Refactored drop file handler into HandleDropFile() method - CI builds both SDL2 and SDL3 on all three platforms: Linux (apt sdl2-dev / SDL3 from source), Windows (vcpkg), macOS (brew sdl2 / SDL3 from source) - vcpkg.json includes both sdl2 and sdl3
doncollins1985
force-pushed
the
sdl3-upgrade
branch
from
July 21, 2026 16:56
fa9a136 to
3fc5f23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.