Skip to content

feat: add dual SDL2/SDL3 support with CMake option#129

Open
doncollins1985 wants to merge 1 commit into
projectM-visualizer:masterfrom
doncollins1985:sdl3-upgrade
Open

feat: add dual SDL2/SDL3 support with CMake option#129
doncollins1985 wants to merge 1 commit into
projectM-visualizer:masterfrom
doncollins1985:sdl3-upgrade

Conversation

@doncollins1985

Copy link
Copy Markdown
  • 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
  • SDL3 audio capture uses SDL_AudioStream API
  • SDL key constants remapped via #undef/#define for SDL3 naming
  • Guarded projectm_create_with_opengl_load_proc for older libprojectM
  • CI builds both SDL2 and SDL3 on all four platforms: Ubuntu Linux, Arch Linux, Windows (vcpkg), macOS (Homebrew)
  • vcpkg.json includes both sdl2 and sdl3
  • Windows runner pinned to windows-2022 for VS 2022 compatibility

- 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
- SDL3 audio capture uses SDL_AudioStream API
- SDL key constants remapped via #undef/#define for SDL3 naming
- Guarded projectm_create_with_opengl_load_proc for older libprojectM
- CI builds both SDL2 and SDL3 on all four platforms:
  Ubuntu Linux, Arch Linux, Windows (vcpkg), macOS (Homebrew)
- vcpkg.json includes both sdl2 and sdl3
- Windows runner pinned to windows-2022 for VS 2022 compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant