Does SDL completely encapsulates D3D and OpenGL APIs?

Simple question: can I develop a complete 3D game which its code is completely agnostic to a specific graphics API (D3D or OpenGL) using SDL?

I couldn’t find a direct and objective answer to this question so far. Some places there are ppl saying SDL will not completely abstract the graphics backend and therefore one still needs to call SDL interface functions of a specific backend, and at others, ppl saying one could develop completely agnostic to the graphics backend using SDL as SDL will choose which backend to use at compile-time based upon the target platform the code is being built.

No, you cannot do this.
For an “agnostic” way try
There is also an example where the SDL is a layer between the OS and the application
And there is a 3D game engine implementation on top of bgfx

1 Like

Not the question you asked, but perhaps worth pointing out that you can run the OpenGL backend in Windows so in practice you can write an OS-agnostic 3D game even though you can’t write a graphics API-agnostic 3D game.

1 Like