Page 1 of 2

SDL VS SFML

Posted: Sat May 22, 2010 11:16 pm
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.

Re: SDL VS SFML

Posted: Sat May 22, 2010 11:18 pm
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...

Re: SDL VS SFML

Posted: Sat May 22, 2010 11:25 pm
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.

Re: SDL VS SFML

Posted: Sat May 22, 2010 11:28 pm
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.

Re: SDL VS SFML

Posted: Sat May 22, 2010 11:32 pm
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.

Re: SDL VS SFML

Posted: Sun May 23, 2010 12:01 am
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?

Re: SDL VS SFML

Posted: Sun May 23, 2010 12:49 am
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.

Re: SDL VS SFML

Posted: Sun May 23, 2010 5:59 am
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!

Re: SDL VS SFML

Posted: Sun May 23, 2010 7:45 am
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.

Re: SDL VS SFML

Posted: Sun May 23, 2010 8:03 am
by K-Bal
Live-Dimension wrote:
K-Bal wrote:If you are using C
SFML has a C port.
You are right ;)

Re: SDL VS SFML

Posted: Sun May 23, 2010 8:35 am
by GroundUpEngine
Neither.

It's personal preference ;)

Re: SDL VS SFML

Posted: Sun May 23, 2010 6:09 pm
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.

Re: SDL VS SFML

Posted: Mon May 24, 2010 2:01 am
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.

Re: SDL VS SFML

Posted: Mon May 24, 2010 4:04 am
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.

Re: SDL VS SFML

Posted: Mon May 24, 2010 5:09 am
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.