Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a1e6788
WIP: Migrating from SDL2 to SDL 3
tobbi Oct 4, 2025
8b15515
Continue migration
tobbi Oct 4, 2025
571b526
More SDL3 compatibility
tobbi Oct 4, 2025
9ec97c6
More changes to SDL3 API
tobbi Oct 4, 2025
d45b1ee
ScreenManager migration
tobbi Oct 4, 2025
db67d95
Changes in src/video/
tobbi Oct 4, 2025
f0f90df
More WIP migration
tobbi Oct 4, 2025
c57759d
More SDLBaseVideoSystem work
tobbi Oct 4, 2025
fce37d2
Install SDL_ttf in Mac workflow, fix linter issues
tobbi Oct 4, 2025
1bba843
Include changes to tinygettext to get submodule to compile
tobbi Oct 5, 2025
8a5c9b6
Install SDL3 on Linux using vcpkg
tobbi Oct 5, 2025
aa1e8eb
Disable manifest mode, remove package name from x86 stuff
tobbi Oct 5, 2025
bba19c3
Install sdl3-image with "jpeg" feature set
tobbi Oct 5, 2025
7e6a562
Always update vcpkg packages before installing
tobbi Oct 5, 2025
588e9c4
Install libltdl-dev as requested before vcpkg install of libxcrypt
tobbi Oct 5, 2025
1b0a146
Install sdl3-ttf on Windows with harfbuzz support
tobbi Oct 5, 2025
9695d4e
Integrate vcpkg with cmake for both Linux architectures
tobbi Oct 5, 2025
49f4f4e
Change Emscripten SDL versions to 3
tobbi Oct 5, 2025
012bd18
More emscripten
tobbi Oct 5, 2025
18c95b9
Let's see if that fixes emscripten
tobbi Oct 5, 2025
a078304
Install sdl3-ttf for emscripten as well, as well as find it through c…
tobbi Oct 5, 2025
e4100ad
Don't import SDL3 target on emscripten
tobbi Oct 5, 2025
74c0087
Maybe fix linux builds
tobbi Oct 5, 2025
c57491c
Presumably fix missing terminator
tobbi Oct 5, 2025
952c5cc
Provide correct target triplet name
tobbi Oct 5, 2025
8aa6dd3
Fix another typo in gnulinux.yml
tobbi Oct 5, 2025
04c13e4
More SDL3 migration
tobbi Oct 5, 2025
91d2701
Fix SDLBaseVideoSystem compilation
tobbi Oct 5, 2025
f5fe8ff
Create SDL IO from file instead of providing own implementation
tobbi Oct 5, 2025
c6356ad
Fix SDL3 linkage in SDL_SavePNG projects
tobbi Oct 5, 2025
e8a7d80
Update to Ubuntu SDK 24.04
tobbi Oct 5, 2025
69b3211
Use ubuntu sdk 24.04 click framework
tobbi Oct 5, 2025
0ee0ba9
Correct library name for clickable, list libraries
tobbi Oct 5, 2025
d391c61
Correct library name again
tobbi Oct 5, 2025
3d9bb0e
Hopefully fix clickable once and for all
tobbi Oct 5, 2025
17e24ec
Change policy version to 24.04
tobbi Oct 5, 2025
531f0b2
Specify docker image, maybe?
tobbi Oct 5, 2025
7ceda88
Another attempt
tobbi Oct 5, 2025
33e7f6c
Revert changes again
tobbi Oct 5, 2025
dca2bb4
Include SDL_main
tobbi Oct 6, 2025
ea41280
Patch dbus vcpkg port file to get dbus to compile on Linux 32 bit
tobbi Oct 6, 2025
1e3153c
Add forgotten dbus.patch
tobbi Oct 6, 2025
dab60ef
Fix installation root variable
tobbi Oct 6, 2025
f18d7d6
Patch dbus again
tobbi Oct 6, 2025
ed65cf1
Use powershell for patching
tobbi Oct 6, 2025
296829d
Tell git to ignore filemode
tobbi Oct 6, 2025
484cc70
Another attempt at fixing
tobbi Oct 6, 2025
f764e87
Fix more stuff
tobbi Oct 6, 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
6 changes: 3 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
jobs:
build-android:
env:
# Revision of https://github.com/pelya/commandergenius.git - SDL2 repo is a submodule
# Revision of https://github.com/pelya/commandergenius.git - SDL3 repo is a submodule
# We check out a specific stable revision, so the build won't break if I modify my SDL repo
SDL_ANDROID_REV: 798fd0f5e167aa6ecce33623dbf88ebc6cd647ea
# It takes 35 minutes per one architecture to build SuperTux, of which 20 minutes are for building Boost and ICU libraries
Expand All @@ -53,8 +53,8 @@ jobs:
run: >
git submodule update --init --recursive --depth=1
project/jni/boost/src project/jni/iconv/src
project/jni/sdl2 project/jni/sdl2_image
project/jni/sdl2_mixer project/jni/sdl2_ttf
project/jni/sdl3 project/jni/sdl3_image
project/jni/sdl3_mixer project/jni/sdl3_ttf

- name: Symlink the application dir
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
pkg install -y git
pkg install -y cmake
pkg install -y googletest
pkg install -y sdl2
pkg install -y sdl2_image
pkg install -y sdl3
pkg install -y sdl3_image
pkg install -y openal-soft
pkg install -y glew
# pkg install -y glbinding # TODO: Uncomment whenever possible
Expand Down
45 changes: 31 additions & 14 deletions .github/workflows/gnulinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Patch vcpkg dbus portfile on 32-bit
if: ${{ matrix.arch == 32 }}
shell: pwsh
run: |
# Patch dbus port file to work around dbus issue on 32-bit
# See https://github.com/microsoft/vcpkg/issues/40031
git config core.filemode false
cp mk/vcpkg/dbus.patch $Env:VCPKG_INSTALLATION_ROOT
pushd $Env:VCPKG_INSTALLATION_ROOT
git apply dbus.patch
popd

- name: Install 64-bit dependencies
if: ${{ matrix.arch == 64 }}
run: |
Expand All @@ -76,8 +88,6 @@ jobs:
libogg-dev \
libvorbis-dev \
libopenal-dev \
libsdl2-dev \
libsdl2-image-dev \
libglib2.0-dev \
libfreetype6-dev \
libraqm-dev \
Expand All @@ -89,7 +99,16 @@ jobs:
libphysfs-dev \
zlib1g-dev \
lcov \
doxygen
doxygen \
libltdl-dev

# Let's get out of this directory to disable vcpkg manifest mode.
# Manifest mode is not adequate here because most dependencies can
# be used via the system package manager.
pushd /

vcpkg update
vcpkg install --triplet x64-linux sdl3 sdl3-image sdl3-ttf

- name: Install 32-bit dependencies
if: ${{ matrix.arch == 32 }}
Expand All @@ -114,21 +133,21 @@ jobs:
libogg-dev:i386 \
libvorbis-dev:i386 \
libopenal-dev:i386 \
libsdl2-dev:i386 \
libsdl2-image-dev:i386 \
libfreetype6-dev:i386 \
libcurl4-openssl-dev:i386 \
zlib1g-dev:i386 \
libfmt-dev:i386 \
libglm-dev

libglm-dev \
libltdl-dev

# Let's get out of this directory to disable vcpkg manifest mode.
# Manifest mode is not adequate here because most dependencies can
# be used via the system package manager.
pushd /

# These libraries don't exist for 32-bit in Ubuntu repositories.
vcpkg install --triplet x86-linux physfs glew libraqm
vcpkg update
vcpkg install --triplet x86-linux physfs glew libraqm sdl3 sdl3-image sdl3-ttf

popd

Expand Down Expand Up @@ -181,12 +200,10 @@ jobs:
-DCMAKE_POLICY_VERSION_MINIMUM="3.5" `
-DSUPERTUX_PACKAGE_VERSION="$Env:GIT_TAG dev - $Env:GIT_HASH ($Env:GIT_BRANCH) (CI ARTIFACT)" `
-DSUPERTUX_VERSION_STRING="$Env:GIT_BRANCH-$Env:GIT_HASH" `
$(if ($Env:32BIT -eq "true") {
"-DCMAKE_TOOLCHAIN_FILE=$Env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake "
"-DVCPKG_TARGET_TRIPLET=x86-linux "
"-DVCPKG_MANIFEST_MODE=OFF "
"-DPhysFS_PREFER_FIND_PACKAGE=ON"
}) `
-DCMAKE_TOOLCHAIN_FILE="$Env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_MANIFEST_MODE=OFF `
-DPhysFS_PREFER_FIND_PACKAGE=ON `
-DVCPKG_TARGET_TRIPLET="$(if ($Env:32BIT -eq "true") {"x86"} else {"x64"})-linux" `
-DBUILD_DOCUMENTATION="$(if ($Env:MAKE_DOCS -eq "true") {"ON"} else {"OFF"})" `
-DCMAKE_CXX_FLAGS="$(if ($Env:32BIT -eq "true") {"-m32"})" `
-DCMAKE_C_FLAGS="$(if ($Env:32BIT -eq "true") {"-m32"})" `
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
cp -rf ./mk/brew/glm.rb $(brew --repository homebrew/core)/Formula/
HOMEBREW_NO_AUTO_UPDATE=1 brew install glm --build-from-source
brew install cmake bash rename libogg libvorbis glew \
openal-soft sdl2 sdl2_image libraqm freetype \
openal-soft sdl3 sdl3_image sdl3_ttf libraqm freetype \
glib gtk-doc zlib physfs fmt

install_name_tool -change \
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ jobs:
run: |
cd C:/
vcpkg integrate install
vcpkg update
vcpkg install curl:$Env:ARCH-windows
vcpkg install glew:$Env:ARCH-windows
vcpkg install libogg:$Env:ARCH-windows
vcpkg install libvorbis:$Env:ARCH-windows
vcpkg install openal-soft:$Env:ARCH-windows
vcpkg install sdl2:$Env:ARCH-windows
vcpkg install sdl2-image[libjpeg-turbo]:$Env:ARCH-windows
vcpkg install sdl3:$Env:ARCH-windows
vcpkg install sdl3-image[jpeg]:$Env:ARCH-windows
vcpkg install sdl3-ttf[harfbuzz]:$Env:ARCH-windows
vcpkg install glm:$Env:ARCH-windows
vcpkg install zlib:$Env:ARCH-windows
vcpkg install fmt:$Env:ARCH-windows
Expand Down
28 changes: 15 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@ add_package(TARGET Freetype
PKG Freetype PKG_USE Freetype::Freetype CONFIG REQUIRED PKG_CONFIG freetype2)
add_package(TARGET RAQM
PKG RAQM PKG_USE RAQM CONFIG PKG_CONFIG libraqm raqm)
add_package(TARGET SDL3
PKG SDL3 PKG_USE SDL3::SDL3 CONFIG REQUIRED PKG_CONFIG sdl3 SDL3)
add_package(TARGET SDL3_image
PKG SDL3_image PKG_USE SDL3_image::SDL3_image CONFIG REQUIRED PKG_CONFIG SDL3_image sdl3_image)
add_package(TARGET SDL3_ttf
PKG SDL3_ttf PKG_USE SDL3_ttf::SDL3_ttf CONFIG REQUIRED PKG_CONFIG SDL3_ttf sdl3_ttf)

if(NOT EMSCRIPTEN)
add_package(TARGET SDL2
PKG SDL2 PKG_USE SDL2::SDL2 CONFIG REQUIRED PKG_CONFIG sdl2 SDL2)
add_package(TARGET SDL2_image
PKG SDL2_image PKG_USE SDL2_image::SDL2_image CONFIG REQUIRED PKG_CONFIG SDL2_image sdl2_image)
add_package(TARGET libcurl
PKG CURL PKG_USE CURL::libcurl PKG_CONFIG libcurl)
add_package(TARGET OpenAL
Expand All @@ -189,11 +191,11 @@ endif()

if(TARGET RAQM)
message(STATUS "Compiling SDL_ttf with RAQM")
set(SDL2TTF_RAQM ON)
set(SDL3TTF_RAQM ON)
endif()

add_subdirectory(external/sexp-cpp EXCLUDE_FROM_ALL)
add_subdirectory(external/SDL_ttf EXCLUDE_FROM_ALL)
#add_subdirectory(external/SDL_ttf EXCLUDE_FROM_ALL)
add_subdirectory(external/SDL_SavePNG EXCLUDE_FROM_ALL)
add_subdirectory(external/simplesquirrel EXCLUDE_FROM_ALL)
add_subdirectory(external/partio_zip EXCLUDE_FROM_ALL)
Expand Down Expand Up @@ -299,18 +301,18 @@ else()
target_link_libraries(supertux2 PUBLIC simplesquirrel)
endif()
target_link_libraries(supertux2 PUBLIC
tinygettext sexp SDL_SavePNG SDL2_ttf
tinygettext sexp SDL_SavePNG SDL3_ttf
PartioZip OpenAL FindLocale obstack glm fmt PhysFS)
target_compile_definitions(supertux2 PUBLIC GLM_ENABLE_EXPERIMENTAL)

if(NOT EMSCRIPTEN)
target_link_libraries(supertux2 PUBLIC
# SDL2_image
SDL2_image
# SDL2 main (windows?)
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
# SDL2
SDL2
# SDL3_image
SDL3_image
# SDL3 main (windows?)
$<TARGET_NAME_IF_EXISTS:SDL3::SDL3main>
# SDL3
SDL3
)
target_link_libraries(supertux2 PUBLIC
Ogg
Expand Down
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ For ease of use, here are some installation lines for some Linux distributions:

- Ubuntu 22.xx or later:
```
sudo apt-get update && sudo apt-get install -y cmake build-essential libogg-dev libvorbis-dev libopenal-dev libsdl2-dev libsdl2-image-dev libfreetype6-dev libraqm-dev libcurl4-openssl-dev libglew-dev libharfbuzz-dev libfribidi-dev libglm-dev zlib1g-dev libfmt-dev libsdl2-ttf-dev libphysfs-dev
sudo apt-get update && sudo apt-get install -y cmake build-essential libogg-dev libvorbis-dev libopenal-dev libsdl3-dev libsdl3-image-dev libfreetype6-dev libraqm-dev libcurl4-openssl-dev libglew-dev libharfbuzz-dev libfribidi-dev libglm-dev zlib1g-dev libfmt-dev libsdl3-ttf-dev libphysfs-dev
```

- ArchLinux (using sudo, as of August 28th 2024)
```
sudo pacman -S cmake base-devel libogg libvorbis openal sdl2 sdl2_image sdl2_ttf freetype2 libraqm curl openssl glew harfbuzz fribidi glm zlib fmt physfs
sudo pacman -S cmake base-devel libogg libvorbis openal sdl3 sdl3_image sdl3_ttf freetype2 libraqm curl openssl glew harfbuzz fribidi glm zlib fmt physfs
```

### Linux/UNIX using CMake
Expand Down
6 changes: 3 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ SuperTux 0.4.0 (2015-12-20)

Compared to 0.1.3, this release features:

* a nearly completely rewritten game engine based on OpenGL, OpenAL, SDL2, ...
* a nearly completely rewritten game engine based on OpenGL, OpenAL, SDL3, ...
* support for translations
* in-game manager for downloadable add-ons and translations
* Bonus Island III, a for now unfinished Forest Island and the development levels in Incubator Island
Expand Down Expand Up @@ -231,7 +231,7 @@ SuperTux 0.3.5 (2015-04-11)

In celebration of SuperTux's 15 year anniversary, we are releasing SuperTux 0.3.5.

This release includes the switch to SDL2 for graphics rendering, a few performance
This release includes the switch to SDL3 for graphics rendering, a few performance
improvements, tons of bugfixes, new tiles and badguys amongst other things.

NOTE: Due to the planned shutdown of Google Code, the SuperTux source code has
Expand All @@ -243,7 +243,7 @@ http://supertux.lethargik.org/wiki/Changelog_0.3.5

Major changes in this release:

* move to SDL2 for graphics rendering
* move to SDL3 for graphics rendering
* glow effects
* new badguys: iceflame, ghostflame, livefire, goldbomb, smartblock
* new bonuses: coinrain, coinexplode
Expand Down
16 changes: 8 additions & 8 deletions clickable.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
clickable_minimum_required: 7
framework: "ubuntu-sdk-20.04"
framework: "ubuntu-sdk-24.04"
builder: "cmake"
build_dir: "build.clickable"
image_setup:
Expand All @@ -12,8 +12,8 @@ dependencies_target:
- "libogg-dev"
- "libvorbis-dev"
- "libopenal-dev"
- "libsdl2-dev"
- "libsdl2-image-dev"
- "libsdl3"
- "libsdl3-image"
- "libphysfs-dev"
- "libcurl4-openssl-dev"
- "libfreetype6-dev"
Expand All @@ -25,10 +25,10 @@ install_lib:
- "/usr/lib/${ARCH_TRIPLET}/libvorbis.so*"
- "/usr/lib/${ARCH_TRIPLET}/libvorbisfile.so*"
- "/usr/lib/${ARCH_TRIPLET}/libopenal.so*"
- "/usr/lib/${ARCH_TRIPLET}/libSDL2.so*"
- "/usr/lib/${ARCH_TRIPLET}/libSDL2-2.0.so*"
- "/usr/lib/${ARCH_TRIPLET}/libSDL2_image.so*"
- "/usr/lib/${ARCH_TRIPLET}/libSDL2_image-2.0.so*"
- "/usr/lib/${ARCH_TRIPLET}/libSDL3.so*"
- "/usr/lib/${ARCH_TRIPLET}/libSDL3-2.0.so*"
- "/usr/lib/${ARCH_TRIPLET}/libSDL3_image.so*"
- "/usr/lib/${ARCH_TRIPLET}/libSDL3_image-2.0.so*"
- "/usr/lib/${ARCH_TRIPLET}/libfreetype.so*"
- "/usr/lib/${ARCH_TRIPLET}/libraqm.so*"
- "/usr/lib/${ARCH_TRIPLET}/libcurl.so*"
Expand All @@ -41,4 +41,4 @@ build_args:
- "-DWARNINGS=ON"
- "-DWERROR=ON"
- "-DCLICK_ARCH=${ARCH}"
- "-DCLICK_FRAMEWORK=ubuntu-sdk-20.04"
- "-DCLICK_FRAMEWORK=ubuntu-sdk-24.04"
2 changes: 1 addition & 1 deletion external/SDL_SavePNG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ project(SDL_SavePNG)

add_library(SDL_SavePNG OBJECT ${PROJECT_SOURCE_DIR}/savepng.c)
set_target_properties(SDL_SavePNG PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(SDL_SavePNG PUBLIC PNG SDL2)
target_link_libraries(SDL_SavePNG PUBLIC PNG SDL3)
target_include_directories(SDL_SavePNG PUBLIC ${PROJECT_SOURCE_DIR})
2 changes: 1 addition & 1 deletion external/SDL_SavePNG/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <SDL.h>
#include <SDL3/SDL.h>

#include "savepng.h" // includes <png.h>, you must link with -lpng

Expand Down
Loading
Loading