SDL VS SFML

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Which is better?

SDL
7
30%
SFML
5
22%
They Both Have Pros and Cons
11
48%
 
Total votes: 23

User avatar
davidthefat
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 529
Joined: Mon Nov 10, 2008 3:51 pm
Current Project: Fully Autonomous Robot
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: California
Contact:

SDL VS SFML

Post by davidthefat »

So I have seen a lot of people use SFML, I want to know what all the buzz is about and why it is better than SDL. Personally I use SDL. I want to know if SFML is better or not. They both seem to have the same purpose and I don't know what would be better.
XianForce
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 767
Joined: Wed Oct 29, 2008 8:36 pm

Re: SDL VS SFML

Post by XianForce »

davidthefat wrote:So I have seen a lot of people use SFML, I want to know what all the buzz is about and why it is better than SDL. Personally I use SDL. I want to know if SFML is better or not. They both seem to have the same purpose and I don't know what would be better.
I am like 99% sure that SFML uses OpenGL for it's graphics... So it ends up being faster for the most part...
User avatar
ibly31
Chaos Rift Junior
Chaos Rift Junior
Posts: 312
Joined: Thu Feb 19, 2009 8:47 pm
Current Project: Like... seven different ones
Favorite Gaming Platforms: Xbox 360, Gamecube
Programming Language of Choice: C++, ObjC
Location: New Jersey.

Re: SDL VS SFML

Post by ibly31 »

I'd say that SDL is better for beginners because of its simplicity and the fact that Lazyfoo exists. He helped me so much in learning how to use it. Also, SFML is better for more advanced users because of how fast it is and also it has a bunch of ports to different languages, so if your making a universal game, that would be very helpful.
Image
Twitter
Website/Tumblr
My Projects

The best thing about UDP jokes is that I don’t care if you get them or not.
XianForce
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 767
Joined: Wed Oct 29, 2008 8:36 pm

Re: SDL VS SFML

Post by XianForce »

ibly31 wrote:I'd say that SDL is better for beginners because of its simplicity and the fact that Lazyfoo exists. He helped me so much in learning how to use it. Also, SFML is better for more advanced users because of how fast it is and also it has a bunch of ports to different languages, so if your making a universal game, that would be very helpful.
Well the 'difficulty' is really relative. I'd say for most people that have used OO languages, SFML will come more easily than SDL.
User avatar
mv2112
Chaos Rift Junior
Chaos Rift Junior
Posts: 240
Joined: Sat Feb 20, 2010 4:15 am
Current Project: Java Tower Defence Game
Favorite Gaming Platforms: N64/Xbox 360/PC/GameCube
Programming Language of Choice: C/++, Java
Location: /usr/home/mv2112
Contact:

Re: SDL VS SFML

Post by mv2112 »

A while ago, i tried SFML, but i think i set it up wrong because when i rendered the screen it started spewing out crap that i had rendered with an openGL app i had. But the OO did seem alot more easier than plain SDL.
User avatar
Bakkon
Chaos Rift Junior
Chaos Rift Junior
Posts: 384
Joined: Wed May 20, 2009 2:38 pm
Programming Language of Choice: C++
Location: Indiana

Re: SDL VS SFML

Post by Bakkon »

ibly31 wrote:I'd say that SDL is better for beginners because of its simplicity and the fact that Lazyfoo exists.
SFML is much simpler than SDL and the tutorials on their website is formatted better than LazyFoo. It's also a lot more powerful right off the bat without needing a bunch of extension libraries.
davidthefat wrote:So I have seen a lot of people use SFML, I want to know what all the buzz is about and why it is better than SDL. Personally I use SDL. I want to know if SFML is better or not. They both seem to have the same purpose and I don't know what would be better.
Here's a crazy idea: Go try it and see what you like better. Why do you need other people to tell you want library to use?
User avatar
ibly31
Chaos Rift Junior
Chaos Rift Junior
Posts: 312
Joined: Thu Feb 19, 2009 8:47 pm
Current Project: Like... seven different ones
Favorite Gaming Platforms: Xbox 360, Gamecube
Programming Language of Choice: C++, ObjC
Location: New Jersey.

Re: SDL VS SFML

Post by ibly31 »

Bakkon wrote: SFML is much simpler than SDL and the tutorials on their website is formatted better than LazyFoo. It's also a lot more powerful right off the bat without needing a bunch of extension libraries.
For me, SDL was easier to learn, not sure why. It seemed like the code was simpler. Depends on how you define simple... simple as in library-simple, or amount-of-code-you-have-to-write simple.
Image
Twitter
Website/Tumblr
My Projects

The best thing about UDP jokes is that I don’t care if you get them or not.
K-Bal
ES Beta Backer
ES Beta Backer
Posts: 701
Joined: Sun Mar 15, 2009 3:21 pm
Location: Germany, Aachen
Contact:

Re: SDL VS SFML

Post by K-Bal »

Just some recommendations:

- If you are using C++ and/or want to program for PC and/or want native use of OpenGL than go for SFML.
- If you are using C and/or want to program for embedded devices and/or want to write software rendering stuff use SDL.

However, you should make your own decision!
Live-Dimension
Chaos Rift Junior
Chaos Rift Junior
Posts: 345
Joined: Tue Jan 12, 2010 7:23 pm
Favorite Gaming Platforms: PC - Windows 7
Programming Language of Choice: c++;haxe
Contact:

Re: SDL VS SFML

Post by Live-Dimension »

It's quite simple really, They are pretty much par-for-par. The only real differences is that SFML uses OGL where as SDL relies (generally) on software. As such, SFML is faster, and it also supports right out the box hardware accelerated rotation + stretching. It supports more image formats right off the bat. It also has a simple pixel shader language based of OGL. SFML would (I expect) use a smaller code base as SDL has more modes to support (software, OGL, hardware render modes).

On the other hand, SFML *cannot* be run on any device that doesn't support OGL, or any device with a very very weak graphics card. Some people's computers have difficulty running simple popcap games for instance.

SDL has far better OS and language support, but SFML is far more feature rich. If I was doing a simple card game/pacman/something simple I'd probably look at SDL for its better compatibility (Software OR OGL modes) but otherwise, I prefer SFML.

Oh, and SFML has far better documentation (if I remember correctly) and some decent tutorials for getting started.
K-Bal wrote:If you are using C
SFML has a C port.
Really, there isn't much more to say. If you still can't choose, then I suggest SFML as it's easier (IMO) to use with less road-blocks.
Image
K-Bal
ES Beta Backer
ES Beta Backer
Posts: 701
Joined: Sun Mar 15, 2009 3:21 pm
Location: Germany, Aachen
Contact:

Re: SDL VS SFML

Post by K-Bal »

Live-Dimension wrote:
K-Bal wrote:If you are using C
SFML has a C port.
You are right ;)
User avatar
GroundUpEngine
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 835
Joined: Sun Nov 08, 2009 2:01 pm
Current Project: mixture
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: UK

Re: SDL VS SFML

Post by GroundUpEngine »

Neither.

It's personal preference ;)
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: SDL VS SFML

Post by Ginto8 »

SFML is:
  • faster
    more feature-rich (sprite rotation&stuff)
    they're working on batch rendering tiles for SFML 2.0 (I LOVE batch rendering)
    more than one window
    awesome networking package
    less clunky
    still has a C interface
So I'll have to say that SFML is better. However, it will likely be a long time before it overtakes SDL because there aren't really any good beginner tutorials for it. SDL has lazyfoo.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
Live-Dimension
Chaos Rift Junior
Chaos Rift Junior
Posts: 345
Joined: Tue Jan 12, 2010 7:23 pm
Favorite Gaming Platforms: PC - Windows 7
Programming Language of Choice: c++;haxe
Contact:

Re: SDL VS SFML

Post by Live-Dimension »

Ginto8 wrote:SFML is:
  • faster
    more feature-rich (sprite rotation&stuff)
    they're working on batch rendering tiles for SFML 2.0 (I LOVE batch rendering)
    more than one window
    awesome networking package
    less clunky
    still has a C interface
So I'll have to say that SFML is better. However, it will likely be a long time before it overtakes SDL because there aren't really any good beginner tutorials for it. SDL has lazyfoo.
If you can call lazyfoo a good beginner tutorial :P

Someday I shall look into doing a "simple" tutorial game with SFML, covering basics but also more advanced topics.
Image
Xeno
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 12
Joined: Fri Jun 05, 2009 5:03 am

Re: SDL VS SFML

Post by Xeno »

It's personal preference imo.

SFML may be written in c++ but it's just as easy to incorporate SDL into a c++ project in an OO manner.

Also for everyone saying SDL only has software rendering, well you can pass the SDL_HWSURFACE flag to change that, or alternatively the SDL_OPENGL flag, and then use straight opengl calls like glBegin(GL_QUADS); e.t.c.
K-Bal
ES Beta Backer
ES Beta Backer
Posts: 701
Joined: Sun Mar 15, 2009 3:21 pm
Location: Germany, Aachen
Contact:

Re: SDL VS SFML

Post by K-Bal »

Xeno wrote:SFML may be written in c++ but it's just as easy to incorporate SDL into a c++ project in an OO manner.
You will see yourself writing wrapper classes that look similar to SFML.
Also for everyone saying SDL only has software rendering, well you can pass the SDL_HWSURFACE flag to change that, or alternatively the SDL_OPENGL flag, and then use straight opengl calls like glBegin(GL_QUADS); e.t.c.
Using pure OpenGL is always possible if you can create a render context. I don't think that this is an argument.
Post Reply