Skip to content

Commit 621f01f

Browse files
committed
Add SDL3 as a platform backend
- Select backend using `-Dplatform_backend=X` where X is 'sdl' or 'sokol' - Default backend is sokol - Adds SDL build to 3rdparty - SDL is only built when selected - Add GitHub actions to ensure the build works for supported targets - Renamed AppBackendConfig => PlatformHooks - Linux and Emscripten Ahoy! (Windows and MacOS pending) - sokol_gfx swapchain parameters initialized differently for SDL
1 parent 59b9ff9 commit 621f01f

File tree

14 files changed

+2060
-204
lines changed

14 files changed

+2060
-204
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [ubuntu-latest]
11+
backend: [sdl, sokol]
12+
optimize: [Debug]
13+
name: Zig Build
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: mlugg/setup-zig@v1
18+
with:
19+
version: 0.13.0
20+
21+
- if: ${{ matrix.os == 'ubuntu-latest' }}
22+
run: |
23+
sudo apt update
24+
sudo apt install \
25+
build-essential \
26+
libasound2-dev \
27+
libpulse-dev \
28+
libaudio-dev \
29+
libjack-dev \
30+
libsndio-dev \
31+
libx11-dev \
32+
libxext-dev \
33+
libxrandr-dev \
34+
libxcursor-dev \
35+
libxfixes-dev \
36+
libxi-dev \
37+
libxss-dev \
38+
libxkbcommon-dev \
39+
libdrm-dev \
40+
libgbm-dev \
41+
libgl1-mesa-dev \
42+
libgles2-mesa-dev \
43+
libegl1-mesa-dev \
44+
libdbus-1-dev \
45+
libibus-1.0-dev \
46+
libudev-dev \
47+
fcitx-libs-dev
48+
49+
- name: Build Linux
50+
run: zig build -Dplatform_backend=${{ matrix.backend }} -Doptimize=${{ matrix.optimize }}
51+
52+
- name: Build Windows
53+
run: zig build -Dplatform_backend=${{ matrix.backend }} -Doptimize=${{ matrix.optimize }} -Dtarget=x86_64-windows
54+
55+
- name: Build Wasm32
56+
run: zig build -Dplatform_backend=${{ matrix.backend }} -Doptimize=${{ matrix.optimize }} -Dtarget=wasm32-emscripten
57+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ zig-cache
22
.zig-cache
33
zig-out
44
.DS_Store
5+
*.sublime-workspace

0 commit comments

Comments
 (0)