-
Notifications
You must be signed in to change notification settings - Fork 452
Upgrade to SDL3 #6234
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
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. |
peppy
left a comment
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 ✅
| 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. |
bdach
left a comment
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 SDLtonamespace SDL&class SDL3(made more sense as the functions are imported fromSDL3.dll)SDL3classIntPtr, which means more "unsafe" coderef,in&outto pointers (unfortunate, but automatically generating these would be hell)ReadOnlySpan<byte>, requiringEncoding.UTF8.GetBytes()calls or UTF-8 string literalsbuild-scripits/rename_symbols.pySDL3ControllerBindingslogic (basically per SDL3 migration guide)SDL_DisplayIDinstead of previously used display indexDisplayMode.RefreshRatechanged frominttofloatWindowsMouseHandlermouse logicSDL_pen.hwould be the replacement for that, but it's currently only supported on LinuxWindowsWindowto account forSDL_SYSWMEVENTremovalJetBrains.Annotationsto latest versionIssues
IOpenGLGraphicsSurface.BackbufferFramebufferused to return useful information on iOSSDL_SysWMinfo.info.uikit.framebufferlibsdl-org/SDL#9430WindowsMouseHandlerlogic was removed)Future work
Testing
I've tested mouse, keyboard