aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaytan <laytanlaats@hotmail.com>2025-06-02 21:14:59 +0200
committerGitHub <noreply@github.com>2025-06-02 21:14:59 +0200
commit9f773f08f8a6a4ed17413ccb5bbc72ac8e17537a (patch)
treeeebdb36cf6fccb65d5ef244a850000dd52bea4e8
parent8135dda2fc42b3c474f0a77d7f03126b2eb8c034 (diff)
parente09f226126367ee4328237511de9cb621de805d3 (diff)
Merge pull request #5260 from laytan/examples-all-sdl3-and-wgpu-glue
add examples/all/sdl3 for all sdl3 dependant packages
-rw-r--r--.github/workflows/ci.yml34
-rw-r--r--examples/all/all_vendor_windows.odin12
-rw-r--r--examples/all/sdl3/all_sdl3.odin13
-rw-r--r--examples/all/sdl3/all_sdl3_windows.odin5
4 files changed, 43 insertions, 21 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8ae39667b..356a977b0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -32,8 +32,8 @@ jobs:
gmake -C vendor/miniaudio/src
./odin check examples/all -vet -strict-style -disallow-do -target:netbsd_amd64
./odin check examples/all -vet -strict-style -disallow-do -target:netbsd_arm64
- ./odin check vendor/sdl3 -vet -strict-style -disallow-do -target:netbsd_amd64 -no-entry-point
- ./odin check vendor/sdl3 -vet -strict-style -disallow-do -target:netbsd_arm64 -no-entry-point
+ ./odin check examples/all/sdl3 -vet -strict-style -disallow-do -target:netbsd_amd64 -no-entry-point
+ ./odin check examples/all/sdl3 -vet -strict-style -disallow-do -target:netbsd_arm64 -no-entry-point
./odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
./odin test tests/core/speed.odin -file -all-packages -vet -strict-style -disallow-do -o:speed -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
./odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
@@ -64,7 +64,7 @@ jobs:
gmake -C vendor/cgltf/src
gmake -C vendor/miniaudio/src
./odin check examples/all -vet -strict-style -disallow-do -target:freebsd_amd64
- ./odin check vendor/sdl3 -vet -strict-style -disallow-do -target:freebsd_amd64 -no-entry-point
+ ./odin check examples/all/sdl3 -vet -strict-style -disallow-do -target:freebsd_amd64 -no-entry-point
./odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
./odin test tests/core/speed.odin -file -all-packages -vet -strict-style -disallow-do -o:speed -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
./odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
@@ -124,8 +124,8 @@ jobs:
run: ./odin run examples/demo -debug
- name: Odin check examples/all
run: ./odin check examples/all -strict-style -vet -disallow-do
- - name: Odin check vendor/sdl3
- run: ./odin check vendor/sdl3 -strict-style -vet -disallow-do -no-entry-point
+ - name: Odin check examples/all/sdl3
+ run: ./odin check examples/all/sdl3 -strict-style -vet -disallow-do -no-entry-point
- name: Normal Core library tests
run: ./odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -sanitize:address
- name: Optimized Core library tests
@@ -160,18 +160,18 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: ./odin check examples/all -vet -strict-style -disallow-do -target:openbsd_amd64
- - name: Odin check vendor/sdl3 for Linux i386
+ - name: Odin check examples/all/sdl3 for Linux i386
if: matrix.os == 'ubuntu-latest'
- run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:linux_i386
- - name: Odin check vendor/sdl3 for Linux arm64
+ run: ./odin check examples/all/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:linux_i386
+ - name: Odin check examples/all/sdl3 for Linux arm64
if: matrix.os == 'ubuntu-latest'
- run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:linux_arm64
- - name: Odin check vendor/sdl3 for FreeBSD amd64
+ run: ./odin check examples/all/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:linux_arm64
+ - name: Odin check examples/all/sdl3 for FreeBSD amd64
if: matrix.os == 'ubuntu-latest'
- run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:freebsd_amd64
- - name: Odin check vendor/sdl3 for OpenBSD amd64
+ run: ./odin check examples/all/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:freebsd_amd64
+ - name: Odin check examples/all/sdl3 for OpenBSD amd64
if: matrix.os == 'ubuntu-latest'
- run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:openbsd_amd64
+ run: ./odin check examples/all/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:openbsd_amd64
build_windows:
name: Windows Build, Check, and Test
@@ -208,11 +208,11 @@ jobs:
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
odin check examples/all -vet -strict-style -disallow-do
- - name: Odin check vendor/sdl3
+ - name: Odin check examples/all/sdl3
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point
+ odin check examples/all/sdl3 -vet -strict-style -disallow-do -no-entry-point
- name: Core library tests
shell: cmd
run: |
@@ -295,8 +295,8 @@ jobs:
- name: Odin check examples/all
run: ./odin check examples/all -target:linux_riscv64 -vet -strict-style -disallow-do
- - name: Odin check vendor/sdl3
- run: ./odin check vendor/sdl3 -target:linux_riscv64 -vet -strict-style -disallow-do -no-entry-point
+ - name: Odin check examples/all/sdl3
+ run: ./odin check examples/all/sdl3 -target:linux_riscv64 -vet -strict-style -disallow-do -no-entry-point
- name: Install riscv64 toolchain and qemu
run: sudo apt-get install -y qemu-user qemu-user-static gcc-12-riscv64-linux-gnu libc6-riscv64-cross
diff --git a/examples/all/all_vendor_windows.odin b/examples/all/all_vendor_windows.odin
index df6542cdd..3daf527ce 100644
--- a/examples/all/all_vendor_windows.odin
+++ b/examples/all/all_vendor_windows.odin
@@ -1,11 +1,15 @@
package all
-import wgpu "vendor:wgpu"
-import b2 "vendor:box2d"
-import game_input "vendor:windows/GameInput"
-import XAudio2 "vendor:windows/XAudio2"
+import wgpu "vendor:wgpu"
+import wgpu_glfw_glue "vendor:wgpu/glfwglue"
+import wgpu_sdl_glue "vendor:wgpu/sdl2glue"
+import b2 "vendor:box2d"
+import game_input "vendor:windows/GameInput"
+import XAudio2 "vendor:windows/XAudio2"
_ :: wgpu
+_ :: wgpu_glfw_glue
+_ :: wgpu_sdl_glue
_ :: b2
_ :: game_input
_ :: XAudio2
diff --git a/examples/all/sdl3/all_sdl3.odin b/examples/all/sdl3/all_sdl3.odin
new file mode 100644
index 000000000..550275af0
--- /dev/null
+++ b/examples/all/sdl3/all_sdl3.odin
@@ -0,0 +1,13 @@
+/*
+Imports all packages using SDL3, can't go in the parent directory
+because SDL2 and SDL3 will have naming conflicts.
+*/
+package all_sdl3
+
+import SDL "vendor:sdl3"
+import IMG "vendor:sdl3/image"
+import TTF "vendor:sdl3/ttf"
+
+_ :: SDL
+_ :: IMG
+_ :: TTF
diff --git a/examples/all/sdl3/all_sdl3_windows.odin b/examples/all/sdl3/all_sdl3_windows.odin
new file mode 100644
index 000000000..28a0fec90
--- /dev/null
+++ b/examples/all/sdl3/all_sdl3_windows.odin
@@ -0,0 +1,5 @@
+package all_sdl3
+
+import wgpu_sdl3_glue "vendor:wgpu/sdl3glue"
+
+_ :: wgpu_sdl3_glue