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

Xeno
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 12
Joined: Fri Jun 05, 2009 5:03 am

Re: SDL VS SFML

Post by Xeno »

K-Bal wrote:
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.
Well i'm not really arguing that SDL is better than SFML, I'm just showing how they are more or less equivalent with the only major difference being syntax.
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 »

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.
Wrong. Like K-Bal said, you'll basically rewrite something almost equivalent to SFML, just limited by a single window and SDL's feature-lacking blitting. Also, saying that SDL is better because it can be used in C is just as wrong; SFML has a C interface that provides the same amount of functionality as the C++ binding. Overall, SFML is better, but, as I said, more people have used SDL and it has practically become the standard, and changing standards is quite difficult.
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.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: SDL VS SFML

Post by Falco Girgis »

Ginto8 wrote:SFML is:
  • faster
orly? Because I'm calling bullshit...

Your "speed" comparisons are unfair at best. You're only comparing SDL's software blitting to SFML's hardware accelerated rendering. SDL is an entire low level multimedia library. I have a hard time seeing an extremely object oriented framework like SFML really outperforming SDL.

SDL's video subsystem is software based by design. There are times and places where this is desirable. Extending SDL with OpenGL THEN making the comparison is far more fair.
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 »

GyroVorbis wrote:
Ginto8 wrote:SFML is:
  • faster
orly? Because I'm calling bullshit...

Your "speed" comparisons are unfair at best. You're only comparing SDL's software blitting to SFML's hardware accelerated rendering. SDL is an entire low level multimedia library. I have a hard time seeing an extremely object oriented framework like SFML really outperforming SDL.

SDL's video subsystem is software based by design. There are times and places where this is desirable. Extending SDL with OpenGL THEN making the comparison is far more fair.
OK. You have a point. I'm not saying that it is any better if you're using OpenGL directly (in fact it's probably worse), but it IS true that its rendering is much faster, and yes, that is primarily due to it being hardware-accelerated. However, there are a lot of people that DON'T use OpenGL directly, and just want an easy and fast rendering and windowing library. So for people like that, SFML is far superior. For people who prefer OpenGL, SDL is marginally faster.
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.
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: SDL VS SFML

Post by avansc »

SFML has a C library, also, you could argue the exact same thing with SFML and GL.

Personally i dont think the speeds are relevent enough to bitch, both for the most part do things in immediate mode. so both are relativly slow in what can be done. SFML is much more feature rich in the core lib, i know SDL has a slew of addons that made it decent. Im curious to see if SFML does the batchrendering, im assuming that means using FBO and what not.

In the end its really a moot point, because no one concerned with speed is going to use either directly for rendering. That being said, in most cases either will perform perfectly fine for small indy games. Just find one you like and use that.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
RyanPridgeon
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 447
Joined: Sun Sep 21, 2008 1:34 pm
Current Project: "Triangle"
Favorite Gaming Platforms: PC
Programming Language of Choice: C/C++
Location: UK
Contact:

Re: SDL VS SFML

Post by RyanPridgeon »

Ugh, this thread is so stupid.
Ryan Pridgeon
C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal
Music | Blog
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: SDL VS SFML

Post by dandymcgee »

K-Bal wrote:
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.
For me, I see writing these wrapper classes on my own as valuable experience and having more control over the things that are powering my project. If I didn't care about having control I would use C#.

That being said, I think SFML is better suited for someone looking to create a game without wanting to spend as much time on basic OO design concepts ( like writing a Sprite class ).
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
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 »

RyanPridgeon wrote:Ugh, this thread is so stupid.
Why?
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 »

dandymcgee wrote:
K-Bal wrote:
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.
For me, I see writing these wrapper classes on my own as valuable experience and having more control over the things that are powering my project. If I didn't care about having control I would use C#.

That being said, I think SFML is better suited for someone looking to create a game without wanting to spend as much time on basic OO design concepts ( like writing a Sprite class ).
So tell me why my game with SFML has already about 50 classes and I'm polymorphing my ass off ;)
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: SDL VS SFML

Post by dandymcgee »

K-Bal wrote: So tell me why my game with SFML has already about 50 classes and I'm polymorphing my ass off ;)
I didn't say you couldn't, I said you didn't have to.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
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 may be interesting for me to point out that with all the time I've spent with SFML, I kinda would prefer SDL if it had the same feature list as SFML. It always seems a shame to extend xyz SFML class just to add a few functions/methods, and creating wrapper classes for SFML classes is also abit strange.

I'm considering maybe giving the SFML C port a try for this very reason. Yeah, it might sound weird, but I don't like how much of a framework SFML provides. Then again, if I had the time i'd actually be making my own OpenGL 2D engine :lol:.
Image
Post Reply