Why would I Use SDL2 over SFML?

I have novice C++ experience, I have played with SFML before but i hear SDL2 is more cross platform. Is this true? My question is in your opinion; Why I would use SDL2 over SFML? Thak you in advance. I am also asking the opposite question on the SFML forums.

Hi,

I’ve used both SDL2 and SFML(in the past before SDL2).
I have to say that in my opinion SDL2 is better.
SDL2 runs on Android/iOS smartphones/tablets.
The Windows/macOS/Linux desktop versions of current SDL2 are just about perfect.
SDL2 is used in Valve’s Steam game lineup so you know it’s “battle tested”.

I would say give SDL2 a try!
Good documentation and tutorials are all available throughout the Internet.

If you want, my team just released a finished SDL2 game project.
You can access the full project including source code on GitHub below:

The SDL2 community is also very helpful.
Feel free to ask questions about using SDL2 here in the official forum.

Jesse

I’ve migrated my mini-engine (https://gitlab.com/kipar/nonoengine) from SFML to SDL because after many tries i’ve failed to make custom shaders to work on SFML. At first I’ve tried PushOpenGLStates and other hacks like resetting a Viewport, but no luck. Then i decided to drop SFML RenderWindow and use SFML Window just to keep other useful things from SFML, but still no luck. Perhaps that’s just me, but in SDL2 everything works like a charm.
On the other hand, SDL miss some high level features of SFML:

  • nice cached text rendering. SDL_ttf can be really slow on low-end hardware.
  • SDL_mixer doesn’t manage multiple sound buffers as easily as SFML (that uses OpenAL).
  • SFML rendering primitives are much more advanced than SDL rectangles.