-
-
Notifications
You must be signed in to change notification settings - Fork 407
SDL3 Support #1915
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
base: 9.0.0-dev
Are you sure you want to change the base?
SDL3 Support #1915
Conversation
the thing is sdl module needs to switched with sdl3 and vulkan implementation needed in lime and SDL android java codes needs to be updated too |
I did update the module to SDL3. |
I meant to say SDL2 needs to be removed from the lime and fully switched with SDL3 |
It does not? I don't see why SDL2 shouldn't be an option. |
Interesting that the proposal is to have both available Maybe the SDL2 can be available, and used by default, and deprecated later as Lime's SDL3 implementation is proven to be stable. |
It was mostly because mojoAL doesn't have a SDL3 version yet, and from what I was reading on the build files it's used for Audio on the Switch |
It'a also used instead of OpenAL Soft when static linking (due to licensing conflicts) I believe |
I accidentally pulled develop into tbe branch, not sure what to do about that. |
That was a lot of work, wew |
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.
We have been reviewing this pull request internally and have found no major issues so far, only a couple missing graphics (which should be trivially resolved on our end). Performance seems similar and it would be great to have the new features introduced once this is merged.
Good to know! About missing graphics, I've had a few FileIO issues, but I thought I had (finally) fully fixed them, could you elaborate one what you mean? I just wanna make sure I didn't break something |
Theres only one function in this PR that I needed to get, which was SDL_GetTicksNS(), which is similar to the function being exposed as "System::GetTimer();" I implemented this as "System::GetTimerNS();" but I am wondering of other SDL3 only features have yet to be exposed? Otherwise this PR looks good :D |
After more testing I found that the missing graphic was related to how I was handling SDL timestamps, and resolving the issue fixed the graphic. There are no FileIO issues that I am aware of. |
Oh yeah definitely, I at the very least want to
I also know SDL3 adds a camera API who would allow us to implement Camera support, same thing with the System Tray API. The only thing currently exposed is that enabling high DPI should also work on windows now, the above is only my wishlist/to work on list after this one gets merged. If you wanna see everything SDL3 adds this is a pretty good list, though I noticed it doesn't mention some things like SDL_WINDOW_TRANSPARENT |
We've asked Fancy to wait on exposing any of SDL3's new features. To be clear, we definitely plan to take advantage of many of those new features in Lime and OpenFL because there are a lot of very nice things in SDL3. However, in terms of testing and review, it's much easier if we can focus on the upgrade with the same set of features that already existed in SDL2. After we merge this foundational SDL3 support, then we can start having fun with the new stuff. |
Awesome! Can't wait :D |
It will also be great to start seeing changes in OpenFL as well, such as replacing this line with the proper nanosecond timestamp call: (i.e. finally resolving #1569 ) |
That line only affects the flash target... and does not actually solve anything. We also can't use anything from our native libraries in flash at all. WIth that said, the main loop has been overhauled for exact preciseness with better support for vsync (and fallback for hardware that doesnt support vsync). Most of that work is about 95% complete and should make it's way into 8.3 over the coming months. |
I tried this on Android and image files (PNG atleast) decoding seems to have broke? I did some logging and ended up with the assumption that the |
Also forgot to mention that trying to get displayMode is throwing a segfault for me on Android |
I know it isn't because this whole PR was made on Linux... Very weird Android is broken |
Just chiming in. |
Yay this is really important. I'm glad you chimed in I was just wondering how well this worked on Pi. |
I will close this PR and re open a version with a cleaner tree soon, will also take the time to try to wire mojoAL as it now supports SDL3 |
Today, I took some time to check out this branch, merge in the latest from 9.0.0-dev, and do a little local testing. The Feathers UI components-explorer sample builds and runs with neko, hl, and cpp targets on macOS. However, rendering on my HiDPI monitor is not quite right when I use For iOS, it builds and launches. However, I'm seeing only a white screen when I launch components-explorer. I haven't investigated deeper than that. For Android, it builds, launches, but renders everything at a super tiny scale factor. Probably a similar scaling issue with SDL3's changes to coordinates for HiDPI. I'm planning to test on Windows and Linux later, but these are my initial observations on my main machine. |
That sounds like me using SDL_GetWindowSize() instead of SDL_GL_GetDrawableSize() somewhere |
And I tested Windows and Linux this afternoon. I got sidetracked for a bit because I needed to upgrade from Visual Studio Community 2019 to 2022 to get SDL3 to compile on Windows. I was getting the following error:
Upgrading to VS 2022 fixed it, for some reason. That's fine. I'm glad I'm not on an ancient version of VS anymore. On Linux, rebuilding with hxcpp 4.3.2 didn't work, but I upgraded to latest hxcpp from GitHub and rebuild completed successfully. This is fine. By the time we release Lime 9, hxcpp should be updated on Haxelib anyway. Anyway, on both Windows and Linux, I could compile and run the Feathers UI components-explorer sample. However, both rendered the window at half of the normal width and height. When I tried to set |
…y for high-dpi displays
the display id 0 is now considered an invalid display, and it seems like display ids aren't necessarily incrementing from 1, so check if name is null to determine if id is invalid instead of checking the value of GetNumDisplays()
Current work to get Lime working on SDL3
Fixes: #1848