There's libraries which wrap SDL for Swift and run on Mac, iOS and Linux. Someone should help them to get support for Windows.
This project has a good list of SDL Swift libraries at the end of the page: https://github.com/ctreffs/SwiftSDL2 - but I don't know which one is the best one..
Then, we need to get Swift to compile for Android..
No OP, and I don't know much about game development, but "without any change at all" is too strong. SDL only does so much, and you still need platform-specific APIs for file access, networking (if applicable), threading, etc. So you'll still need platform-specific code until someone writes those abstractions in Swift.
> SDL only does so much, and you still need platform-specific APIs for file access, networking (if applicable), threading, etc. So you'll still need platform-specific code until someone writes those abstractions in Swift.
Isn't that handled by the swift runtime?
By without any changes I meant, without platform-specific recompilation. Very similar to what java runtime provides for JAR.
You'll always need platform-specific recompilation for native executables, as the executable formats are different on different operating systems. The only exceptions are emulation systems like WSL and Wine.
I should have added it to my first post - SDL provides precompiles libraries for different platforms. All I have to do is to distribute them with my game. Does it solve the problem?
not OP either. but i think the problem is simple. apple said no to opengl, which any other platform out there supports.
btw, they are even deprecating opengl! i have no idea what that means for the tons of games written with an opengl backend. probably not an issue for the iOS ecosystem though.
no one in the SDL developer community tells you how to support metal or how to use it. instructions for MacOSX redirects you to another library, which has since removed their instructions.
And in case anybody comes in raving about how Vulkan isn't supported on macOS, that's fine, Vulkan-to-Metal compatibility layer libraries are available.
Well, Vulkan is also not supported on PlayStation, XBox, Win32 and UWP sandboxes, Android devices until Android 7, and until version 10 only flagship devices actually had any kind of proper support.