UltravioletFramework / ultraviolet

The Ultraviolet Framework is a .NET game development framework written in C#.
https://github.com/UltravioletFramework/ultraviolet/wiki
MIT License
541 stars 46 forks source link

Update to SDL3 #153

Open jayrulez opened 1 year ago

jayrulez commented 1 year ago

https://github.com/libsdl-org/SDL/blob/main/docs/README-migration.md

amerkoleci commented 1 year ago

You can take look here for sdl3 bindings: https://github.com/amerkoleci/Alimer.Bindings.SDL

jayrulez commented 1 year ago

You can take look here for sdl3 bindings: https://github.com/amerkoleci/Alimer.Bindings.SDL

Thanks!

I'll check it out.

Ultraviolet currently uses a patched build of SDL2 for Android. I'll either needs to drop the patch and modify UV to use stock SDL on Android, or create a similar patch.

https://github.com/UltravioletFramework/ultraviolet-sdl2/commit/53e4146d4555e0e607096151de3e01d37bc75ddb

jayrulez commented 1 year ago

I'll also need bindings for the gesture detection functionality that was dropped in SDL3. Perhaps that could be implemented in C# instead of bindings. https://github.com/libsdl-org/SDL_gesture

jayrulez commented 1 year ago

@tlgkccampbell Do you remember why you patched SDL instead of using the standard SDL main?

tlgkccampbell commented 1 year ago

@jayrulez The unpatched version expects SDL_main to live in a dynamically-linked native library, which isn't something Ultraviolet can accomodate. I needed some way to bootstrap into the .NET code, so I changed the Activity's initialization process to invoke a Java method that could be overridden using the Xamarin bindings instead. I don't know if there's a better way to do this in modern .NET/SDL.

jayrulez commented 1 year ago

Thanks! I will look into this in the next week or so. It would be ideal if I could drop the patch, but the patch is very small so it's not a big deal if I have to keep it around.

jayrulez commented 1 year ago

https://github.com/dotnet/Silk.NET looks like this project uses an unpatched version of SDL for Android. I'll check out how they do it there.