SDL - How much work to port?


#1

Hi everyone! I’ve been a hobbyist dev for a few years mainly using Unity and a little bit of Unreal, and I’ve decided to work on a game in SDL2 in my spare time. The problem is, is that I’m on a Mac, and I’m a little unsure of how Apple’s deprecation of OpenGL would affect my development process. Does SDL use any OpenGL by default on Mac, or does it default to the proprietary API that’s available on the platform that you’re developing on (e.g. SDL would default to using DirectX on Windows and Metal on Mac, without having to write any API-specific code)? My hope is that SDL2 abstracts at least some of that away and lets me work more on handling game-specific stuff.

Thanks! :slight_smile:


#2

If you only need 2D, SDL_Renderer can also use Metal on macOS (or Direct3D on Windows): https://wiki.libsdl.org/CategoryRender

If you need 3D, it’s up to you what API to use anyway, you can use SDL with OpenGL, Vulkan, Metal or Direct3D (but SDL doesn’t abstract those, it only has some helper functions to create OpenGL or Vulkan contexts etc). If you’re looking for a crossplatform 3D rendering abstraction, https://github.com/bkaradzic/bgfx might be of interest (and it also supports SDL).


#3

Okay, thank you very much! I’ll definitely look into BGFX!