5 ms·
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
by RussianCow 6y ago
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.
- blondin 6y agonot 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. so that's what is going on...
- roblabla 6y agoOpenGL isn't relevant here, as SDL2 has a metal backend that's used by default on MacOS. See https://hg.libsdl.org/SDL/rev/1acae5590352 https://hg.libsdl.org/SDL/rev/1acae5590352
- deleted 6y ago[deleted]
- blondin 6y ago> OpenGL isn't relevant here oh nice, i had no idea SDL had metal support! 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. who exactly are we kidding here?
- pjmlp 6y agoThe whole point of using SDL is that the framework takes care of it for you. Here, https://wiki.libsdl.org/SDL_SetHint?highlight=%28%5CbCategoryAPI%5Cb%29%7C%28SDLFunctionTemplate%29 https://wiki.libsdl.org/SDL_SetHint?highlight=%28%5CbCategor... https://wiki.libsdl.org/SDL_HINT_RENDER_DRIVER https://wiki.libsdl.org/SDL_HINT_RENDER_DRIVER And after a 5 minute search, https://gist.github.com/gcatlin/b89e0efed78dd91364609ca4095da346 https://gist.github.com/gcatlin/b89e0efed78dd91364609ca4095d...
- thetinguy 6y agoWhy would you want an old API like OpenGL when you can use Vulkan and Metal
- zapzupnz 6y agoAnd 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.
- pjmlp 6y agoWell, 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.
- iamcreasy 6y ago> 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.
- mkl 6y agoYou'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.
- iamcreasy 6y agoI 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?
- rahkiin 6y agoSwift Foundation is cross platform and provided by apple
- RussianCow 6y agoAh, that's great! I didn't realize Apple open sourced Foundation as well.