Which graphics APIs are used in sdl_renderer

My question is what gfx apis does the sdl rendering module use or enable. In my research, looking at the sdl source code, it seems to support opengl 2.1 on desktop and ES 1 and 2 on mobile. Also metal and a few dxs.

It supports several rendering APIs, and chooses different ones depending on the platform:

On desktop Linux, you’re likely to get OpenGL, but it can also support GLES1 and 2.
On macOS, you’re likely to get Metal on modern Macs, but it can also do OpenGL.
Mobile almost certainly gets ES2 in current times, as does HTML5 builds.
Direct3D 11 is mostly intended for WinRT/UWP, but my understanding is it now works on desktop Windows. But Windows can also use Direct3D 9, OpenGL, ES 1 and 2.

And there’s a software renderer that works everywhere.

Future development will probably result in a Vulkan renderer, too, but we aren’t there yet.

SDL is generally built with every renderer that could possibly work (so, no Direct3D on Unix, no Metal on Windows, etc), and it has a preferred order it tries these APIs in, until it finds one that works.

As you noticed, the SDL/src/render directory has a list of all the existing renderers. The only one I haven’t mentioned is the “psp” one, which is for unofficial/homebrew development for the Sony PSP.

1 Like