Add SDL3 support alongside SDL2

Add optional SDL3 support while keeping SDL2 as the default. SDL3 builds
must be selected explicitly with the SYSTEM3_SDL_VERSION CMake option.

Centralize most SDL2/SDL3 API differences behind compatibility interfaces.
Audio playback uses a dedicated SDL3 backend based on SDL3 audio streams,
implemented separately in mako_sdl3.cpp.

Android and Nintendo Switch remain on SDL2 for now.
This commit is contained in:
kichikuou
2026-09-16 08:44:23 +09:00
parent 647a5aa326
commit 3e32da1d37
40 changed files with 1475 additions and 266 deletions
+11 -5
View File
@@ -8,6 +8,10 @@ env:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
sdl-version: [2, 3]
name: Emscripten SDL${{ matrix.sdl-version }}
steps:
- uses: actions/checkout@v6
@@ -32,9 +36,11 @@ jobs:
- name: Build
run: |
mkdir -p out/wasm
cd out/wasm
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=YES ../../
mkdir -p out/wasm-sdl${{ matrix.sdl-version }}
cd out/wasm-sdl${{ matrix.sdl-version }}
emcmake cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_COMPILE_WARNING_AS_ERROR=YES \
-DSYSTEM3_SDL_VERSION=${{ matrix.sdl-version }} ../..
make -j4
mkdir system3
mv system3.* system3/
@@ -42,5 +48,5 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: system3-wasm
path: out/wasm/system3
name: system3-wasm-sdl${{ matrix.sdl-version }}
path: out/wasm-sdl${{ matrix.sdl-version }}/system3