views:

365

answers:

3

I'm thinking about switching from SDL to SFML, but before I do I want to know which is better. I'm mainly looking for easy sound/music, sprite rotations that are easy on the framerate/cpu, portability, and ease of installation.

+4  A: 

I can't believe nobody's answered this yet!

This is a very meager answer, but I want to get SOMETHING out there...

I've just installed SFML myself. I run Ubuntu 10.04, and all I had to do was build the files from source, and then use apt-get to install missing dependencies like libgl-dev, libglu-dev, etc.

Linking to the dynamic libraries is pretty simple, just read the documentation.

So far I've had little to no trouble with SFML outside of what I'm sure is a simple issue about keyboard input, but then again I only just started today.

I guess all I can really say is... Try it out! Only by playing around with it will you know, for sure, whether it is right for YOU.

Platinum Azure
+2  A: 

Firstly SDL has a more C like API whereas SFML is more C++-ish.

SDL uses software rendering whereas SFML uses openGL. This means that SFML is faster for rich graphics and zooming/rotating/scrolling etc.

SFML's API includes random numbers, networking multithreading and 3d sound. These things are also available for SDL but not included directly.

SDL is older and hence more mature. There are many games/applications made using it and many libraries that can be used on top of it.

I personally found learning SFML easier as it's API is quite simple and the tutorials are easy to understand.

I used SDL for around 2 years and have now switched to SFML. I am finding SFML better for my needs as it has better performance and is easy to use.

priomsrb
+2  A: 

If you want portability, SDL wins hands down. SFML basically targets Windows, Linux and OSX. SDL runs on most major platforms. Desktops, consoles, PDAs, basically anything from Windows to Wii.

If you want maturity and proven performance, SDL wins hands down. There isn't much out there that I'm aware of using SFML for anything serious. SDL has been used for major projects from major studios like Civilization 4, Neverwinter Nights and Quake 4, indie and open source projects like Frozen Bubble and World of Goo, and even emulators like ZSNES.

If you want something which holds your hand by providing things like hardware-accelerated graphics and networking classes out-of-the-box, SFML is far more feature complete and developer-friendly. While SDL is more flexible, it's less intuitive and requires you to provide more of your own foundation/framework code.

I would basically put it down to this: if you're building your own engine, or working on a project where you're going to write a lot of your own scaffolding anyway, SDL is a very safe bet. If it's a fairly small project where you really don't care about the underlying code so long as it just works and works fast, SFML is very reliable and lets you just 'get things done'.

I personally prefer SFML.NET because I don't really care so much about the low-level details with the projects I work on these days and it greatly reduces the time it takes me to get a working prototype of something out the door. If I was working on anything remotely cutting-edge or heavily performance intensive, I'd lean towards SDL but even then unless I really required its portability I'd probably consider other alternatives like DirectX (as an SDL equivalent) or XNA (for the high-level hand-holding) anyway.

FerretallicA
Another thing to note is that SFML is actively developed, very well supported by the lead developer on its forum, and generally very well designed in terms of future-proofing and backward-compatibility between versions without introducing bloat.
FerretallicA