Skip to content

SDL3 port#873

Draft
icculus wants to merge 5 commits into
ioquake:mainfrom
icculus:sdl3
Draft

SDL3 port#873
icculus wants to merge 5 commits into
ioquake:mainfrom
icculus:sdl3

Conversation

@icculus

@icculus icculus commented May 21, 2026

Copy link
Copy Markdown
Member

I did a YouTube video awhile ago, where I ported ioquake3 to SDL3. I thought I might go back and clean up the patch and put it in an pull request.

I see there is also an "sdl3" branch in the official repository, so it's possible we solved all the same problems. If there's something worth stealing from here, or one branch is just preferred over the other, I have no ego in this, so do whatever is best for the project.

Besides that, this PR is marked as a draft because there are things to consider in general:

  • We've lost gamma support, so the brightness settings won't work. SDL3 removed this functionality because it didn't work with individual windows, but only changed the entire display's gamma, and on some platforms, this functionality was being removed anyhow...plus, if the game crashed, the brightness won't be reset. Modern wisdom is to do a post-processing pixel shader that adjusts the final output right before swapping buffers. But we haven't written that shader yet, and would be out of luck on ancient OpenGLs that don't have shaders.
  • We are losing some platforms that were available in SDL2 but dropped in SDL3. Specifically: Google Stadia, NaCL, OS/2, WinPhone, WinRT/UWP. It's possible no one cares about any of these platforms, though. I'm not aware of platforms that maintain an SDL2 fork outside of our repo, but they're going to be out of luck, too if they haven't moved to offer an SDL3 port as well.
  • I didn't provide precompiled SDL3 libraries. We can certainly deal with that if this PR is to be merged.

icculus and others added 4 commits May 20, 2026 15:41
The initial work was done on YouTube: https://youtu.be/i3yVqWYFbCE

This commit has been rebased and tweaked a little since the video.

The SDL3 headers are in the commit before this one, and the SDL2 header
removal follows one after, so as not to junk up this specific commit and make
sure we don't have a commit where the SDL2 build fails.
One would want the game sounds to be reduced such that the microphone
will not pick them up. Currently, it would be reversed, which does not
make sense.

Signed-off-by: Laslo Hunhold <dev@frign.de>
@timangus

Copy link
Copy Markdown
Member

Ah yes, I was made aware. See PR #749.

@icculus

icculus commented May 21, 2026

Copy link
Copy Markdown
Member Author

From the other PR:

Got slight spider man meme vibes at the sound section as I think most of the code he talks about saying "oh they have done X or Y..." was originally written by... Ryan 😁.

Hahaha, totally on brand for me. :)

This PR is in the same situation, waiting on distro packages, etc. Ubuntu, Fedora, and Arch (and probably many others) package it now, but you can't expect it on the older GitHub builders.

For the builders, we could hook up GitHub Actions to use setup-sdl, which will figure out how to build SDL3 for the given platform and cache it for later runs, so you don't need a system package for it. Just needs a few extra lines in .github/workflows/build.yml, in the steps: section, like:

    - name: Set up SDL
      id: sdl
      uses: libsdl-org/setup-sdl@v1
      with:
        version: sdl3-latest
        cmake-generator: Ninja

People with distros that lack SDL3 packages will need to install from source, of course.

Anyhow, merge or steal anything you want from here, or close it outright. I'm happy to help with whatever direction you choose!

@smallmodel

smallmodel commented Jun 20, 2026

Copy link
Copy Markdown

Wow it's Ryan who made the MOHAA Linux port in around 2003 😃

For the GL1 gamma, someone suggested a solution on another issue: #632 (comment)
They implemented it in yquake2 like this: yquake2/yquake2#1237

Some engines have to resort to GL1 due to complexity of some features to be reimplemented in GL2.

@timangus

Copy link
Copy Markdown
Member

Anyhow, merge or steal anything you want from here, or close it outright. I'm happy to help with whatever direction you choose!

I meant to reply to this at the time but evidently completely forgot 🤦. As far as I remember I did a pass through your effort when I was made aware of it and combined the best bits of both into my branch, so basically I've already done the merge/steal part, so it probably makes sense to go with my branch as it's more up to date wrt main, though I do need to rebase it, now that I look at it. The GH action is interesting though; I'm not using that but probably should be. The existing solution is just to grab a tarball and build it on platforms where it's not available, so assuming it works in these places its use will definitely be an improvement.

@icculus

icculus commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

I plugged setup-sdl in here today, which fixed...OpenBSD. Most of the rest of the builds are all exploding because they are expecting an internal copy of libSDL to be in the tree, but it isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants