SDL vs SFML

Pages: 12
I've been trying playing around with SDL and I heard about SFML from some people here so I'm just wondering which one would be better to experiment with first and about their pros and cons.

Needs helpful insight.
Stick to SFML as it will ultimately become more widely used than SDL. The only real reason SDL is so popular is due to amateur game developers. SFML is faster, more modern, and easier to use. I'm not going to list out all the pros and cons for the APIs. I recommend you jump over to the gamdev.net forums where this has been covered in detail.
will ultimately become more widely used than SDL.


Pure assumption...

But I suggest, that You should try out the SFML, too...
Last edited on
Pure Assumption? These APIs are only popular because of the game development community. Spend some time in the game dev forums and you'll see which direction its heading. SDL is a C API, it makes no sense to use if there is an equivalent C++ API which in this case is actually better, however there is nothing wrong with learning both.
SDL is a C API, it makes no sense to use if there is an equivalent C++ API
Unless you're writing in C.
I tried SFML for a day or two, but I could not get a window to display. (Believe me, I tried EVERYTHING).

I then loaded up the SDL libs, and had it going in minutes.
helios wrote:
Unless you're writing in C.


Of course.
I personally prefer SFML over many other media libraries. I also prefer it over the standard pThreads or boost library when it comes to threading. I use it for more then just game dev, though I admit my first project with it was a game.
Return 0 wrote : SDL is a C API, it makes no sense to use if there is an equivalent C++ API
helios wrote : Unless you're writing in C

SFML has a C version
closed account (S6k9GNh0)
SFML uses more modern and cleaner coding techniques, better looking documentation (if you consider external documentation valid), more convenient uses, etc.

SFML also provides a hardware accelerated graphics API where SDL is still based on software rendering and integration with OpenGL is a complete bitch.

SFML, imho, has already surpassed SDL in many aspects as a free multimedia library.
@Vexer

I don't know if you still have a problem displaying a window, or if you even care about it anymore, but in order to display a window, you have to use RenderWindow WhateverYouWantToNameItand then use have to use WhateverYouWantToNameIt.Draw(/*what you want to draw in here*/); in order to draw something on it and WhateverYouWantToNameIt.Display();to actually display the screen.
I think it more likely that as SFML uses hardware rendering that it's probably because he doesn't have a hardware renderer.

If you're on a system using X11 as a window manager I can give you my AIGLX-enabled xorg.conf, which allows you to use hardware rendering.

@Vexer

I don't know if you still have a problem displaying a window, or if you even care about it anymore, but in order to display a window, you have to use RenderWindow WhateverYouWantToNameItand then use have to use WhateverYouWantToNameIt.Draw(/*what you want to draw in here*/); in order to draw something on it and WhateverYouWantToNameIt.Display();to actually display the screen.


Thanks, but I actually just had problems getting the window itself to display(not actually getting something to draw). I might give it another try and see if I can get it to work.
What operating system are you using?
Did it compile fine.... Which IDE are you using? I've heard/read that VC++ 10 isn't completely compatible with SFML apparently.
Google doesn't yield anything relevant.
@AngelHoof:

That might be a problem, because I am using VS 2010.

I'll try VS2008 and get back to you.
Were you able to find a download for it? I'm trying to use the SFML networking extension and I can't do anything because I'm using 2010.
I managed to get a window displayed with 2010, but after closing it I get a stack corruption error.
I get access violation errors whenever sending a UDP packet.
Pages: 12