Skip to content

Commit 7efbabb

Browse files
sdl3
1 parent d938c1f commit 7efbabb

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ jobs:
3131
3232
- name: Build SDL
3333
run: |
34-
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.32.8.tar.gz
35-
tar xvfz release-2.32.8.tar.gz
34+
wget https://github.com/libsdl-org/SDL/releases/download/release-3.2.28/SDL3-3.2.28.tar.gz
35+
tar xvfz SDL3-3.2.28.tar.gz
3636
mkdir build
3737
cd build
38-
cmake ../SDL-release-2.32.8 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
38+
cmake ../SDL3-3.2.28 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DSDL_VULKAN=OFF
3939
cmake --build . --config Release
4040
sudo cmake --install .
4141
@@ -137,11 +137,11 @@ jobs:
137137
138138
- name: Build SDL
139139
run: |
140-
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.32.8.tar.gz
141-
tar xvfz release-2.32.8.tar.gz
140+
wget https://github.com/libsdl-org/SDL/releases/download/release-3.2.28/SDL3-3.2.28.tar.gz
141+
tar xvfz SDL3-3.2.28.tar.gz
142142
mkdir build
143143
cd build
144-
cmake ../SDL-release-2.32.8 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
144+
cmake ../SDL3-3.2.28 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DSDL_VULKAN=OFF
145145
cmake --build . --config Release
146146
sudo cmake --install .
147147
@@ -440,11 +440,11 @@ jobs:
440440
441441
- name: Build SDL
442442
run: |
443-
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.32.8.tar.gz
444-
tar xvfz release-2.32.8.tar.gz
443+
wget https://github.com/libsdl-org/SDL/releases/download/release-3.2.28/SDL3-3.2.28.tar.gz
444+
tar xvfz SDL3-3.2.28.tar.gz
445445
mkdir build
446446
cd build
447-
cmake ../SDL-release-2.32.8 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
447+
cmake ../SDL3-3.2.28 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DSDL_VULKAN=OFF
448448
cmake --build . --config Release
449449
sudo cmake --install .
450450
@@ -545,17 +545,17 @@ jobs:
545545
with:
546546
submodules: recursive
547547

548-
- name: Download SDL2
549-
run: curl -L -o SDL2.zip https://github.com/libsdl-org/SDL/releases/download/release-2.30.8/SDL2-devel-2.30.8-VC.zip
548+
- name: Download SDL3
549+
run: curl -L -o SDL3.zip https://github.com/libsdl-org/SDL/releases/download/prerelease-3.3.4/SDL3-devel-3.3.4-VC.zip
550550

551551
- name: Create extraction directory
552-
run: mkdir ${{ runner.temp }}\SDL2
552+
run: mkdir ${{ runner.temp }}\SDL3
553553

554-
- name: Unzip SDL2
555-
run: tar -xf SDL2.zip -C ${{ runner.temp }}\SDL2 --strip-components=1
554+
- name: Unzip SDL3
555+
run: tar -xf SDL3.zip -C ${{ runner.temp }}\SDL3 --strip-components=1
556556

557-
- name: Set SDL2_DIR environment variable
558-
run: echo SDL2_DIR=${{ runner.temp }}\SDL2\cmake >> $env:GITHUB_ENV
557+
- name: Set SDL3_DIR environment variable
558+
run: echo SDL3_DIR=${{ runner.temp }}\SDL3\cmake >> $env:GITHUB_ENV
559559

560560
- name: Setup Python
561561
uses: actions/setup-python@v5
@@ -588,8 +588,8 @@ jobs:
588588
env:
589589
RAYLIB_PLATFORM: ${{ matrix.raylib-platform }}
590590
run: |
591-
copy ${{ runner.temp }}\SDL2\lib\x64\SDL2.lib .
592-
copy ${{ runner.temp }}\SDL2\lib\x64\SDL2.dll raylib\
591+
copy ${{ runner.temp }}\SDL3\lib\x64\SDL3.lib .
592+
copy ${{ runner.temp }}\SDL3\lib\x64\SDL3.dll raylib\
593593
python -m pip install --upgrade pip
594594
pip3 install --upgrade "cffi"
595595
pip3 install --upgrade wheel
@@ -637,17 +637,17 @@ jobs:
637637
with:
638638
submodules: recursive
639639

640-
- name: Download SDL2
641-
run: curl -L -o SDL2.zip https://github.com/libsdl-org/SDL/releases/download/release-2.32.10/SDL2-devel-2.32.10-VC.zip
640+
- name: Download SDL3
641+
run: curl -L -o SDL3.zip https://github.com/libsdl-org/SDL/releases/download/prerelease-3.3.4/SDL3-devel-3.3.4-VC.zip
642642

643643
- name: Create extraction directory
644-
run: mkdir ${{ runner.temp }}\SDL2
644+
run: mkdir ${{ runner.temp }}\SDL3
645645

646-
- name: Unzip SDL2
647-
run: tar -xf SDL2.zip -C ${{ runner.temp }}\SDL2 --strip-components=1
646+
- name: Unzip SDL3
647+
run: tar -xf SDL3.zip -C ${{ runner.temp }}\SDL3 --strip-components=1
648648

649-
- name: Set SDL2_DIR environment variable
650-
run: echo SDL2_DIR=${{ runner.temp }}\SDL2\cmake >> $env:GITHUB_ENV
649+
- name: Set SDL3_DIR environment variable
650+
run: echo SDL3_DIR=${{ runner.temp }}\SDL3\cmake >> $env:GITHUB_ENV
651651

652652
- name: Setup Python
653653
uses: actions/setup-python@v5
@@ -682,8 +682,8 @@ jobs:
682682
env:
683683
RAYLIB_PLATFORM: ${{ matrix.raylib-platform }}
684684
run: |
685-
copy ${{ runner.temp }}\SDL2\lib\x86\SDL2.lib .
686-
copy ${{ runner.temp }}\SDL2\lib\x86\SDL2.dll raylib\
685+
copy ${{ runner.temp }}\SDL3\lib\x86\SDL3.lib .
686+
copy ${{ runner.temp }}\SDL3\lib\x86\SDL3.dll raylib\
687687
python -m pip install --upgrade pip
688688
pip3 install --upgrade "cffi"
689689
pip3 install --upgrade wheel

raylib/build.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def check_raylib_pkgconfig_installed():
6262
return subprocess.run(['pkg-config', '--libs', 'raylib'], text=True, stdout=subprocess.PIPE).returncode == 0
6363

6464
def check_sdl_pkgconfig_installed():
65-
# this should be 'pkg-config --exists sdl2' but result is non-deterministic on old versions of pkg-config!
66-
return subprocess.run(['pkg-config', '--libs', 'sdl2'], text=True, stdout=subprocess.PIPE).returncode == 0
65+
# this should be 'pkg-config --exists sdl3' but result is non-deterministic on old versions of pkg-config!
66+
return subprocess.run(['pkg-config', '--libs', 'sdl3'], text=True, stdout=subprocess.PIPE).returncode == 0
6767

6868

6969
def get_the_include_path_from_pkgconfig(libname):
@@ -145,7 +145,7 @@ def build_unix():
145145

146146
if RAYLIB_PLATFORM=="SDL" and os.getenv("RAYLIB_LINK_ARGS") is None and not check_sdl_pkgconfig_installed():
147147
print("PKG_CONFIG_PATH is set to: "+os.getenv("PKG_CONFIG_PATH"))
148-
raise Exception("ERROR: SDL2 not found by pkg-config. Please install pkg-config and SDL2."
148+
raise Exception("ERROR: SDL3 not found by pkg-config. Please install pkg-config and SDL3."
149149
"or else set RAYLIB_LINK_ARGS env variable.")
150150

151151
raylib_include_path = os.getenv("RAYLIB_INCLUDE_PATH")
@@ -226,7 +226,7 @@ def build_unix():
226226
'-framework', 'IOKit', '-framework', 'CoreFoundation', '-framework',
227227
'CoreVideo']
228228
if RAYLIB_PLATFORM=="SDL":
229-
extra_link_args += ['/usr/local/lib/libSDL2.a', '-framework', 'CoreHaptics', '-framework', 'ForceFeedback',
229+
extra_link_args += ['/usr/local/lib/libSDL3.a', '-framework', 'CoreHaptics', '-framework', 'ForceFeedback',
230230
'-framework', 'GameController']
231231
libraries = []
232232
extra_compile_args = ["-Wno-error=incompatible-function-pointer-types", "-D_CFFI_NO_LIMITED_API"]
@@ -238,7 +238,7 @@ def build_unix():
238238
extra_link_args = flags.split() + [ '-lm', '-lpthread', '-lGL',
239239
'-lrt', '-lm', '-ldl', '-lpthread', '-latomic']
240240
if RAYLIB_PLATFORM=="SDL":
241-
extra_link_args += ['-lX11','-lSDL2']
241+
extra_link_args += ['-lX11','-lSDL3']
242242
elif RAYLIB_PLATFORM=="DRM":
243243
extra_link_args += ['-lEGL', '-lgbm']
244244
elif RAYLIB_PLATFORM=="PLATFORM_COMMA":
@@ -299,7 +299,7 @@ def build_windows():
299299

300300
libraries = ['raylib', 'gdi32', 'shell32', 'user32', 'OpenGL32', 'winmm']
301301
if RAYLIB_PLATFORM=="SDL":
302-
libraries += ['SDL2']
302+
libraries += ['SDL3']
303303

304304
print("libraries: "+str(libraries))
305305
ffibuilder.set_source("raylib._raylib_cffi", ffi_includes,

raylib/raylib.h.modified

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, const char *text); //
12221222
// Color/pixel related functions
12231223
bool ColorIsEqual(Color col1, Color col2); // Check if two colors are equal
12241224
Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
1225-
int ColorToInt(Color color); // Get hexadecimal value for a Color (0xRRGGBBAA)
1225+
unsigned int ColorToInt(Color color); // Get hexadecimal value for a Color (0xRRGGBBAA)
12261226
Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1]
12271227
Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1]
12281228
Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1]

0 commit comments

Comments
 (0)