WIP: [common] port to SDL3 #2645

Draft
octocar wants to merge 16 commits from octocar/eden:sdl3 into master
First-time contributor
No description provided.
octocar added 7 commits 2025-10-01 21:55:08 +02:00
requested reviews from MrPurple666, MaranBr, Lizzie, crueter, CamilleLaVey, Maufeat 2025-10-01 21:55:08 +02:00
octocar changed title from [common] port to SDL3 to WIP: [common] port to SDL3 2025-10-01 21:56:38 +02:00
octocar added 1 commit 2025-10-01 22:03:52 +02:00
repo name typo
Some checks failed
eden-license / license-header (pull_request) Failing after 24s
dce3d96aaa
octocar force-pushed sdl3 from dce3d96aaa to 726fe8cf09 2025-10-01 22:04:10 +02:00 Compare
crueter requested changes 2025-10-01 22:08:57 +02:00
CMakeLists.txt Outdated
@ -635,16 +635,16 @@ if (ENABLE_SDL2)
if ("${YUZU_SYSTEM_PROFILE}" STREQUAL "steamdeck")
Owner

this is now unneeded

this is now unneeded
octocar marked this conversation as resolved
CMakeLists.txt Outdated
@ -645,3 +645,3 @@
endif()
find_package(SDL2 2.26.4 REQUIRED)
find_package(SDL3 3.2.22 REQUIRED)
Owner

DO NOT always require the newest, we should use 3.2.12 which is the earliest found in any current distro except Ubuntu (which lacks sdl3 entirely)

DO NOT always require the newest, we should use 3.2.12 which is the earliest found in any current distro except Ubuntu (which lacks sdl3 entirely)
octocar marked this conversation as resolved
cpmfile.json Outdated
@ -184,0 +180,4 @@
"repo": "libsdl-org/SDL3",
"version": "3.2.22",
"min_version": "3.2.0",
"cmake_filename": "sdl3"
Owner

This is a special CI repo and should be left as it previously was, I will create an SDL3 CI

This is a special CI repo and should be left as it previously was, I will create an SDL3 CI
octocar marked this conversation as resolved
docs/Deps.md Outdated
@ -33,3 +33,3 @@
* [FFmpeg](https://ffmpeg.org/) (should use `-DYUZU_USE_EXTERNAL_FFMPEG=ON`)
* [SDL2](https://www.libsdl.org/download-2.0.php) 2.0.18+ (should use `-DYUZU_USE_EXTERNAL_SDL2=ON` OR `-DYUZU_USE_BUNDLED_SDL2=ON` to reduce compile time)
* [SDL3](https://github.com/libsdl-org/SDL/releases) 2.0.18+ (should use `-DYUZU_USE_EXTERNAL_SDL3=ON` OR `-DYUZU_USE_BUNDLED_SDL3=ON` to reduce compile time)
Owner

change to 3.2.12+

change to 3.2.12+
octocar marked this conversation as resolved
docs/Deps.md Outdated
@ -203,3 +203,3 @@
* Open the `MSYS2 MinGW 64-bit` shell (`mingw64.exe`)
* Download and install all dependencies using:
* `pacman -Syu git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-qt6 mingw-w64-x86_64-toolchain autoconf libtool automake-wrapper`
* `pacman -Syu git make mingw-w64-x86_64-SDL3 mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-qt6 mingw-w64-x86_64-toolchain autoconf libtool automake-wrapper`
Owner

sdl is now lower case here

sdl is now lower case here
octocar marked this conversation as resolved
@ -251,3 +250,4 @@
if (ENABLE_SDL3)
target_sources(audio_core PRIVATE
sink/sdl2_sink.cpp
sink/sdl2_sink.h
Owner

Update filenames to sdl3

Update filenames to sdl3
octocar marked this conversation as resolved
@ -8,3 +9,3 @@
#include <vector>
#include <SDL.h>
#include <SDL3/SDL.h>
Owner

This shouldn't be necessary

This shouldn't be necessary
octocar marked this conversation as resolved
@ -9,3 +9,3 @@
#include "common/settings.h"
#include "common/thread.h"
#include "common/vector_math.h"
// #include "common/vector_math.h" // Not used directly
Owner

If it's not used you can remove it, no need for comment

If it's not used you can remove it, no need for comment
octocar marked this conversation as resolved
octocar added 5 commits 2025-10-01 22:27:46 +02:00
crueter reviewed 2025-10-01 23:08:00 +02:00
crueter left a comment
Owner

Also, we should update docs to mention that Ubuntu needs to use bundled or external sdl3

Also, we should update docs to mention that Ubuntu needs to use bundled or external sdl3
crueter reviewed 2025-10-01 23:08:06 +02:00
@ -0,0 +8,4 @@
#include <span>
#include <vector>
#include <SDL3/SDL.h>
Owner

Linking to SDL3::SDL3 should set the include directories to include the /path/to/include/SDL3 so SDL.h should still work.

Linking to SDL3::SDL3 *should* set the include directories to include the `/path/to/include/SDL3` so SDL.h should still work.
Author
First-time contributor

SDL.h does not seem to work for me on external dependency

SDL.h does not seem to work for me on external dependency
crueter marked this conversation as resolved
MaranBr force-pushed sdl3 from af6c90e3ff to 4c5aaf7f13 2025-10-02 01:36:30 +02:00 Compare
octocar added 1 commit 2025-10-02 10:17:33 +02:00
fix borderless window
Some checks failed
eden-license / license-header (pull_request) Failing after 29s
ac5e393c5d
octocar added 1 commit 2025-10-02 10:30:52 +02:00
license headers
All checks were successful
eden-license / license-header (pull_request) Successful in 23s
7c64197c27
octocar added 1 commit 2025-10-02 11:18:05 +02:00
process gamepad axis events
All checks were successful
eden-license / license-header (pull_request) Successful in 24s
02bd53f0e6
octocar changed title from WIP: [common] port to SDL3 to [common] port to SDL3 2025-10-02 13:08:35 +02:00
requested review from crueter 2025-10-02 13:08:35 +02:00
Author
First-time contributor

tested:

  • gyro
  • audio
  • cli
  • gamepad
  • keyboard
  • mouse
  • multiple gamepads
tested: - [x] gyro - [x] audio - [x] cli - [x] gamepad - [x] keyboard - [x] mouse - [ ] multiple gamepads
Author
First-time contributor

cpmfile.json may need changes

cpmfile.json may need changes
Member

Build CI failed, check #2645

Build CI failed, check [#2645](https://github.com/Eden-CI/Workflow/actions/runs/18188827228)
Owner

@DraVee wrote in #2645 (comment):

Build CI failed, check #2645

yeah we just need a bundled sdl3

@DraVee wrote in https://git.eden-emu.dev/eden-emu/eden/pulls/2645#issuecomment-5666: > Build CI failed, check [#2645](https://github.com/Eden-CI/Workflow/actions/runs/18188827228) yeah we just need a bundled sdl3
crueter changed title from [common] port to SDL3 to WIP: [common] port to SDL3 2025-10-08 00:09:02 +02:00
crueter force-pushed sdl3 from 02bd53f0e6 to 6c0f4a3472 2025-10-08 00:19:21 +02:00 Compare
crueter added 1 commit 2025-10-08 00:41:45 +02:00
[cmake] sdl3 ci, fixup cpmfile defs, fix sdl headers
All checks were successful
eden-license / license-header (pull_request) Successful in 29s
558922b369
Signed-off-by: crueter <crueter@eden-emu.dev>
Owner

Confirmed that SDL3 works with Gyro + Gamepad and Keyboard + Mouse on system, external, and bundled SDL3 on Linux. Need windows testing

Confirmed that SDL3 works with Gyro + Gamepad and Keyboard + Mouse on system, external, and bundled SDL3 on Linux. Need windows testing
Owner
https://cdn.discordapp.com/attachments/1425279065430167644/1425282292317946017/20251008-0041-07.0469107.mp4?ex=68e70512&is=68e5b392&hm=d6b0709c2db8a5f2878bec4553d344fcdf088a776d35859ad40f71c15086fbba& On Windows, gyro is only working vertically
All checks were successful
eden-license / license-header (pull_request) Successful in 29s
Required
Details
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u sdl3:octocar-sdl3
git checkout octocar-sdl3
Sign in to join this conversation.
No description provided.