Skip to content

SDL3 Support #1915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 69 commits into
base: 9.0.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
6cf22e8
Updated submodule to SDL 3.2.8
Fancy2209 Mar 6, 2025
3cf2147
Commit current progress
Fancy2209 Mar 6, 2025
a1dcf98
Update sdl3-files.xml
Fancy2209 Mar 7, 2025
504df5e
Add missing utf8 conversion for hb_buffer_add_utf8
tobil4sk Mar 10, 2025
0ca7c39
Fix length for hl_hb_buffer_add_utf8
tobil4sk Mar 10, 2025
4104e9f
Merge pull request #1916 from tobil4sk/fix/hb-add-utf8
dimensionscape Mar 10, 2025
417d5f5
Fix typo
Fancy2209 Mar 6, 2025
99209da
IOSHelper: if `xcrun devicectl list devices` fails, try to fall back …
joshtynjala Mar 10, 2025
811cb36
Add config for linux, still missing files on sdl3-files.xml
Fancy2209 Mar 10, 2025
d14f03e
It builds now!
Fancy2209 Mar 10, 2025
6f2f88c
IOSHelper: if no iOS device is connected, look for one that is availa…
joshtynjala Mar 10, 2025
70e55b1
Fix rebuild warning about unknown option on msvc
tobil4sk Mar 10, 2025
28d1ad8
Fix SDL_Init
Fancy2209 Mar 10, 2025
5488eee
IOSHelper: comment about how the Platform == 'iOS' filter used by xcr…
joshtynjala Mar 10, 2025
6283017
Fix GetGlyphIndices returning array of 0 on hl
tobil4sk Mar 11, 2025
f495b77
Remove old comment for hl GetGlyphIndices
tobil4sk Mar 11, 2025
23b90df
Fix loop in GetGlyphIndices with invalid input
tobil4sk Mar 11, 2025
63b9a88
Merge pull request #1921 from tobil4sk/fix/get_glyphs_infinite_loop
dimensionscape Mar 11, 2025
bedd4e9
Merge branch 'openfl:develop' into SDL3
Fancy2209 Mar 11, 2025
46a63dd
Fix SDL Include
Fancy2209 Mar 11, 2025
7fddbe6
Fix Android build errors
Fancy2209 Mar 11, 2025
8a31f1c
Fix Windows SDL3
Fancy2209 Mar 11, 2025
8eacf50
Actually fix SDLWindow.cpp
Fancy2209 Mar 11, 2025
02c0a97
Update SDLWindow.cpp
Fancy2209 Mar 11, 2025
aa940b2
Update SDLJoystick.cpp
Fancy2209 Mar 11, 2025
e7d38a7
Actually actually fix windows
Fancy2209 Mar 11, 2025
b840c22
Update Build.xml
Fancy2209 Mar 11, 2025
f290a6e
Update Build.xml
Fancy2209 Mar 11, 2025
d5d179f
Add AVFoundation to list of linked libs
Fancy2209 Mar 11, 2025
844b1d8
Link CoreHaptics on macOS
Fancy2209 Mar 11, 2025
e184255
Atualizar o config-windows-x86.h
Fancy2209 Mar 11, 2025
045a7bf
Atualizar o config-windows-x86_64.h
Fancy2209 Mar 11, 2025
970bd0e
Fix fread and fwrite partially
Fancy2209 Mar 28, 2025
8e8ac22
fix fread and fwrite
Fancy2209 Mar 28, 2025
d74b0cb
Fix formatting
Fancy2209 Mar 28, 2025
a0ec472
Update project/src/backend/sdl3/SDLSystem.cpp
Fancy2209 Mar 29, 2025
b59e410
Fix building on Windows
Fancy2209 Mar 29, 2025
cbfd08f
Update Build.xml
Fancy2209 Mar 31, 2025
2a5bf19
Fix Android, iOS and macOS hopefully
Fancy2209 Mar 31, 2025
818ea84
Remove UIKit from macOS
Fancy2209 Mar 31, 2025
c776d81
Add missing frameworks for iOS and TVOS
Fancy2209 Mar 31, 2025
99f6a4e
Fix JNI.cpp
Fancy2209 Mar 31, 2025
0e33c77
Add missing file in SDL3
Fancy2209 Mar 31, 2025
ef5b4f9
Update Build.xml
Fancy2209 Mar 31, 2025
90e7f22
Update Build.xml
Fancy2209 Mar 31, 2025
4ac5f5d
Update openal-files.xml
Fancy2209 Mar 31, 2025
7963ac0
Fix paths to renamed files in SDL3
Fancy2209 Mar 31, 2025
2573ef7
SDL_uikit_main.c no longer exists
Fancy2209 Mar 31, 2025
786cfae
SDL_android_main.c is no longer a thing
Fancy2209 Mar 31, 2025
2aca62e
Update libsdl Java and fix iOS
Fancy2209 Mar 31, 2025
e417d97
Don't build HelloWorld on Windows
Fancy2209 Mar 31, 2025
be751d4
Use SDL2 on WinRT, Switch, or if mojoAL is used
Fancy2209 Mar 31, 2025
e56e490
Install SDL3 with brew on iOS Ci
Fancy2209 Mar 31, 2025
5e7909a
Fix whitespace on SDLSystem.cpp
Fancy2209 Mar 29, 2025
6565d20
Include SDL3 Headers in template
Fancy2209 Mar 31, 2025
e6ef72f
Stop installing SDL3 with brew on iOS Ci
Fancy2209 Mar 31, 2025
05b3f22
Print error in SVG
Fancy2209 Mar 31, 2025
1b246a5
Improve SVG Error Log
Fancy2209 Mar 31, 2025
03f23aa
Fix headers included in ios template
Fancy2209 Mar 31, 2025
4ab8c60
Update svg.n
Fancy2209 Mar 31, 2025
fcac8fb
Rebuild svg.n on Ci
Fancy2209 Mar 31, 2025
af70df4
Install deps for svg.n
Fancy2209 Mar 31, 2025
56f32e6
Fix FILE_HANDLE::getFile() on Windows
Fancy2209 Mar 31, 2025
4462970
Add Android file support back
Fancy2209 Mar 31, 2025
c2d50be
Add missing semicolon
Fancy2209 Mar 31, 2025
51170ac
Add missing iOS Deps
Fancy2209 Mar 31, 2025
0f65c80
Fix ios pbxproj
Fancy2209 Mar 31, 2025
2466001
fix GetDisplay
Fancy2209 Apr 1, 2025
88ebd93
Fix Android
Fancy2209 Apr 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:

- name: Install Haxe dependencies
run: |
curl --output ../hxcpp-4.3.45.zip --location https://github.com/HaxeFoundation/hxcpp/releases/download/v4.3.45/hxcpp-4.3.45.zip
haxelib install ../hxcpp-4.3.45.zip --quiet
curl --output ../hxcpp-4.3.73.zip --location https://github.com/HaxeFoundation/hxcpp/releases/download/v4.3.73/hxcpp-4.3.73.zip
haxelib install ../hxcpp-4.3.73.zip --quiet
haxelib install format --quiet
haxelib install hxp --quiet

Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
path = project/lib/sdl
url = https://github.com/libsdl-org/SDL
shallow = true
[submodule "project/lib/sdl3"]
path = project/lib/sdl3
url = https://github.com/libsdl-org/SDL
shallow = true
[submodule "project/lib/openal"]
path = project/lib/openal
url = https://github.com/kcat/openal-soft
Expand Down
75 changes: 70 additions & 5 deletions project/Build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<xml>

<set name="PLATFORM" value="android-21" if="android" />
<set name="HXCPP_CPP11" value="1" />
<set name="HXCPP_CPP17" value="1" />
<setenv name="MACOSX_DEPLOYMENT_TARGET" value="10.13" if="mac" />

<include name="${HXCPP}/build-tool/BuildCommon.xml" />

Expand Down Expand Up @@ -30,7 +31,8 @@
<set name="LIME_OPENGL" value="1" />
<set name="LIME_PIXMAN" value="1" />
<set name="LIME_PNG" value="1" />
<set name="LIME_SDL" value="1" />
<!-- <set name="LIME_SDL" value="1" /> -->
<set name="LIME_SDL3" value="1" />
<!-- <set name="LIME_SDL_ANGLE" value="1" if="windows" unless="static_link" /> -->
<set name="LIME_SDL_ANGLE" value="1" if="windows LIME_SDL_ANGLE" unless="static_link" />
<set name="LIME_SDL_ANGLE" value="1" if="windows angle" unless="static_link" />
Expand All @@ -49,7 +51,8 @@
<set name="NATIVE_TOOLKIT_HAVE_HARFBUZZ" value="1" if="LIME_HARFBUZZ" />
<set name="NATIVE_TOOLKIT_HAVE_MBEDTLS" value="1" if="LIME_MBEDTLS" />
<set name="NATIVE_TOOLKIT_HAVE_PNG" value="1" if="LIME_PNG" />
<set name="NATIVE_TOOLKIT_HAVE_SDL" value="1" if="LIME_SDL" />
<set name="NATIVE_TOOLKIT_HAVE_SDL3" value="1" if="LIME_SDL3" unless="NATIVE_TOOLKIT_HAVE_SDL" />
<set name="NATIVE_TOOLKIT_HAVE_SDL" value="1" if="LIME_SDL" unless="NATIVE_TOOLKIT_HAVE_SDL3" />

<set name="NATIVE_TOOLKIT_SDL_STATIC" value="1" />
<set name="NATIVE_TOOLKIT_SDL_ANGLE" value="1" if="LIME_SDL_ANGLE" />
Expand Down Expand Up @@ -271,6 +274,62 @@

</section>

<section if="LIME_SDL3">

<section if="emscripten">

<compilerflag value="-s" />
<compilerflag value="USE_SDL=3" />

</section>

<section unless="emscripten">

<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl3/include/" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl3/include/SDL3" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl3/include/build-configs/" unless="windows || mac || linux || rpi" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl3/include/build-configs/" if="linux" unless="rpi" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl3/include/build-configs/" if="windows" unless="winrt" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl3/include/build-configs/" if="mac" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl3/include/build-configs/" if="rpi" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl3/include/build-configs/" if="winrt" />

<compilerflag value="-DHAVE_LIBC" />

</section>

<section if="rpi">

<compilerflag value="-I/usr/include/libdrm" />
<compilerflag value="-I/usr/include/dbus-1.0" />
<compilerflag value="-I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include" unless="HXCPP_ARM64" />
<compilerflag value="-I/usr/lib/aarch64-linux-gnu/dbus-1.0/include" if="HXCPP_ARM64" />
<compilerflag value="-I/usr/local/include" />

<compilerflag value="-ldrm" />
<compilerflag value="-lgbm" />

<compilerflag value="-Wl,--no-undefined -lm -ldl -ldrm -lpthread -lrt" />

</section>

<compilerflag value="-DLIME_SDL3" />
<compilerflag value="-DNATIVE_TOOLKIT_SDL_ANGLE" if="NATIVE_TOOLKIT_SDL_ANGLE" />
<compilerflag value="-D__IPHONEOS__" if="ios || tvos" />
<compilerflag value="-D__APPLETVOS__" if="tvos" />
<compilerflag value="-DAPPLETV" if="tvos" />
<compilerflag value="-DHAVE_STDIO_H" unless="windows" />

<file name="src/backend/sdl3/SDLApplication.cpp" />
<file name="src/backend/sdl3/SDLGamepad.cpp" />
<file name="src/backend/sdl3/SDLJoystick.cpp" />
<file name="src/backend/sdl3/SDLKeyCode.cpp" />
<file name="src/backend/sdl3/SDLMutex.cpp" />
<file name="src/backend/sdl3/SDLSystem.cpp" />
<file name="src/backend/sdl3/SDLWindow.cpp" />

</section>

<section if="LIME_TINYFILEDIALOGS">

<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/tinyfiledialogs/" />
Expand Down Expand Up @@ -366,7 +425,8 @@
<include name="lib/openal-files.xml" />
<include name="lib/pixman-files.xml" />
<include name="lib/png-files.xml" />
<include name="lib/sdl-files.xml" />
<include name="lib/sdl3-files.xml" unless="LIME_SDL" />
<include name="lib/sdl-files.xml" unless="LIME_SDL3" />
<include name="lib/tinyfiledialogs-files.xml" />
<include name="lib/vorbis-files.xml" />
<include name="lib/vpx-files.xml" />
Expand Down Expand Up @@ -399,7 +459,8 @@
<files id="native-toolkit-openal" if="LIME_OPENALSOFT" />
<files id="native-toolkit-pixman" if="LIME_PIXMAN" />
<files id="native-toolkit-png" if="LIME_PNG" />
<files id="native-toolkit-sdl" if="LIME_SDL" unless="emscripten" />
<files id="native-toolkit-sdl" if="LIME_SDL" unless="emscripten || LIME_SDL3" />
<files id="native-toolkit-sdl3" if="LIME_SDL3" unless="emscripten || LIME_SDL" />
<files id="native-toolkit-tinyfiledialogs" if="LIME_TINYFILEDIALOGS" />
<files id="native-toolkit-vorbis" if="LIME_VORBIS" />
<files id="native-toolkit-vpx" if="LIME_VPX" />
Expand Down Expand Up @@ -431,6 +492,8 @@
<lib name="shell32.lib" />
<lib name="comdlg32.lib" />
<lib name="setupapi.lib" />

<lib name="avrt.lib" if ="LIME_OPENALSOFT"/>

<lib name="usp10.lib" if="LIME_HARFBUZZ" />
<lib name="rpcrt4.lib" if="LIME_HARFBUZZ" />
Expand Down Expand Up @@ -479,8 +542,10 @@
<vflag name="-framework" value="AudioUnit" />
<vflag name="-framework" value="Carbon" />
<vflag name="-framework" value="Cocoa" />
<vflag name="-framework" value="AVFoundation" />
<vflag name="-framework" value="CoreAudio" />
<vflag name="-framework" value="CoreVideo" />
<vflag name="-framework" value="CoreHaptics" />
<vflag name="-framework" value="ForceFeedback" />
<vflag name="-framework" value="OpenAL" />
<vflag name="-framework" value="OpenGL" />
Expand Down
Loading