-
Notifications
You must be signed in to change notification settings - Fork 419
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
Upgrade to SDL3 #6234
Upgrade to SDL3 #6234
Conversation
This helps with migrating enums, as ClangSharp doesn't put them in the `SDL3` class.
This renames SDL2 symbols to SDL3 names.
Also adds a bunch of `unsafe` /shrug
`WindowsMouseHandler` is not updated as it's on the chopping block.
This is done by SDL now, and the raw input event don't get reported by `SDL_SetWindowsMessageHook`.
Both osuTK and SDL3 use floats.
Still doesn't fix all compile problems.
…at specific index
Code quality wise this looks good to me. |
Linux: Tested on Wayland, and via XWayland, with the configs:
Haven't tested native X11, but that's probably okay. Resolved one issue in the process. |
iOS: OpenGL is broken, but we've disabled that renderer. Metal works fine. |
Android: Works fine. |
@peppy Maybe look to merge after the next release? |
I wouldn't be against getting it in this week's release, thoughts? |
Can give it a shot. My concern would be the issues mentioned in the OP that I'm not fully sure the scope of. |
Yeah let's leave it one release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code quality pass ✅
Tested on macOS ✅
@@ -29,11 +29,11 @@ internal LinuxGameHost(string gameName, HostOptions? options) | |||
|
|||
protected override void SetupForRun() | |||
{ | |||
SDL.SDL_SetHint(SDL.SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, BypassCompositor ? "1" : "0"); | |||
SDL3.SDL_SetHint(SDL3.SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, BypassCompositor ? "1"u8 : "0"u8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never seen this before 🤯
I think we can merge this at any point. We won't be doing another framework release / update before the osu! release this week. That said, I'd probably want @bdach to sign off on this one at whatever depth he feels comfortable doing so. A bit of secondary windows testing is probably most important here, if anything. |
I'm just going to test that this launches in all environments that I have and call it a day. I don't think further review is productive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't die. have not read code. expecting 30 issues that were really upstream issues to be fixed and another 30 to regress
osu! changes: https://github.com/ppy/osu/compare/master...Susko3:osu:wip-SDL3?expand=1
Changes
namespace SDL2
&class SDL
tonamespace SDL
&class SDL3
(made more sense as the functions are imported fromSDL3.dll
)SDL3
classIntPtr
, which means more "unsafe" coderef
,in
&out
to pointers (unfortunate, but automatically generating these would be hell)ReadOnlySpan<byte>
, requiringEncoding.UTF8.GetBytes()
calls or UTF-8 string literalsbuild-scripits/rename_symbols.py
SDL3ControllerBindings
logic (basically per SDL3 migration guide)SDL_DisplayID
instead of previously used display indexDisplayMode.RefreshRate
changed fromint
tofloat
WindowsMouseHandler
mouse logicSDL_pen.h
would be the replacement for that, but it's currently only supported on LinuxWindowsWindow
to account forSDL_SYSWMEVENT
removalJetBrains.Annotations
to latest versionIssues
IOpenGLGraphicsSurface.BackbufferFramebuffer
used to return useful information on iOSSDL_SysWMinfo.info.uikit.framebuffer
libsdl-org/SDL#9430WindowsMouseHandler
logic was removed)Future work
Testing
I've tested mouse, keyboard