Skip to content
New issue

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

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

Already on GitHub? # to your account

Add SDL3 support #3339

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add SDL3 support #3339

wants to merge 6 commits into from

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented Jan 22, 2025

My last change before xmas is still compiling, so just opening a PR here for it.

Depends on the Wii SDL2 branch

@Ghabry Ghabry added the Has PR Dependencies This PR depends on another PR label Jan 22, 2025
@Ghabry Ghabry added this to the 0.8.1 milestone Jan 22, 2025
@github-actions github-actions bot added Window/Scenes Audio Building Documentation Wii Settings All about customizable features, storing and applying them Input Input related (gamepads, keyboard mappings, mouse support). For KeyInputProc, add event/interpreter labels Jan 22, 2025
@Ghabry Ghabry removed Window/Scenes Documentation Wii Settings All about customizable features, storing and applying them Input Input related (gamepads, keyboard mappings, mouse support). For KeyInputProc, add event/interpreter labels Jan 22, 2025
@fdelapena fdelapena removed the Has PR Dependencies This PR depends on another PR label Jan 29, 2025
CMakeLists.txt Outdated Show resolved Hide resolved
@Ghabry
Copy link
Member Author

Ghabry commented Jan 29, 2025

Also have to fix the CMake presets. Will add presets for at least SDL3 and SDL2 (if applicable) and a "default" preset where we can use a recommended default.

Since inception of the presets this feature did not improve, so it will be more cartesian product preset generation (hooray).

@Ghabry
Copy link
Member Author

Ghabry commented Feb 12, 2025

This is now finished.

It still uses SDL2 by default as I don't want to get SDL3 up and working right now for all our ports. Too much work.

Also isn't tested as much as SDL2 yet.

}

Sdl2Audio::~Sdl2Audio() {
SDL_CloseAudioDevice(audio_dev_id);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Arch they replaced sdl2 with sdl2-compat (SDL2 ontop of SDL3). This call aborts now with "Invalid Pointer" (exactly the same reason why I disabled that line in the SDL3 backend)

@Ghabry
Copy link
Member Author

Ghabry commented Feb 12, 2025

Found the related issue: libsdl-org/sdl2-compat#313

SDL_Quit deletes now all the audio stuff. Manually doing audio_.reset() before we call SDL_Quit fixes it. 👍

This is now required by SDL3 because SDL_Quit deletes the audio state.
Added it to all SDL version because it is also triggered by the compat-libraries.
# for free to join this conversation on GitHub. Already have an account? # to comment
Development

Successfully merging this pull request may close these issues.

3 participants