Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1412212 Posts in 69760 Topics- by 58697 Members - Latest Member: Reid

January 25, 2025, 11:54:10 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)C++ users: SDL or SFML?
Pages: [1] 2 3 ... 5
Print
Author Topic: C++ users: SDL or SFML?  (Read 40609 times)
CyanPrime
BANNED
Level 1
*


View Profile
« on: May 21, 2010, 03:26:07 PM »

So after trying SDL and SFML I have to say I like SFML more than SDL, though I wouldn't say SDL is bad. It's just harder to set up, and too modular for me. I like my fonts and image rotating all in one lib.

Anyway, which do you like better and why?
Logged

Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« Reply #1 on: May 21, 2010, 03:34:06 PM »

SFML, because of the interface (API). It's really intuitive, polished and clean.
Logged

Working on HeliBrawl
tapir
Level 0
**


View Profile
« Reply #2 on: May 21, 2010, 03:42:09 PM »

SDL because it's smaller, has no dependencies (other than system libraries) and it works on some mobile platforms with others to come.

I like SFML too.
Logged
Aquin
Level 10
*****


Aquin is over here.


View Profile WWW
« Reply #3 on: May 21, 2010, 04:58:18 PM »

SFML because it's smaller, has less dependencies and works in more places.

Funny.  Giggle
Logged

I'd write a devlog about my current game, but I'm too busy making it.
r.kachowski
Level 5
*****

and certainly no love below


View Profile WWW
« Reply #4 on: May 22, 2010, 07:37:10 AM »

i sense a contradiction here
Logged
ASnogarD
Level 1
*



View Profile
« Reply #5 on: May 22, 2010, 11:07:05 AM »

Keeping an eye on this thread...

I am just nearly finishing basic (seriously noob level) C++ learning, and was wondering SDL or Allegro , never even heard of SFML.

I was leaning to SDL, it seemed to be more powerfull than allegro though more effort was required... and if I am not mistaken, was the more logical path to OpenGL.
Logged

Somethings are painfully obvious, others must be made obvious... painfully.
oahda
Level 10
*****



View Profile
« Reply #6 on: May 22, 2010, 12:13:10 PM »

If you're going to draw using SDL blitting instead of using it with OpenGL, then SFML.
SDL blitting is slow and worthless. SFML is an OpenGL wrapper.
Logged

increpare
Guest
« Reply #7 on: May 22, 2010, 12:38:40 PM »

SFML because it's smaller, has less dependencies and works in more places.
Works in more places?  What do you mean by that?  I haven't looked into this too much, but from what I recall SDL is very very well supported on a lot of platforms.

(as for dependencies, some people would view c++ as being a dependency Wink )

Quote
SDL blitting is slow and worthless. SFML is an OpenGL wrapper.
It's not *that* slow - it's about the same speed as allegro, which is perfectly usable for a wide variety of purposes.  Be prepared for tearing though - it seems impossible to avoid nowadays unless you use OpenGL/whatever (which you get for free with SFML).
Logged
Golds
Loves Juno
Level 10
*


onuJ sevoL


View Profile WWW
« Reply #8 on: May 22, 2010, 01:35:47 PM »

To avoid tearing, all you need is to sync your blits to the VBL (Vertical Sync). 

If you don't do this, your window buffer can get copied to the screen in the middle of copying in the next frame and you get the "tear" effect of part of the current drawing frame overlapping the last frame in the buffer.

Surely SDL can sync its draws to the VBL?
Logged

@doomlaser, mark johns       our company: @DoomlaserCorp
Aquin
Level 10
*****


Aquin is over here.


View Profile WWW
« Reply #9 on: May 22, 2010, 01:41:32 PM »

Hehe, I find that even though SDL works in a lot of places, it doesn't necessarily do a good job.  Using SDL means you'll need to find other libraries to do all the things you need for a video game (like audio.)

I was just being silly before. Tongue

SFML doesn't necessarily have C++ as a dependency.  It's available for a few other languages as well.  It also handles input in a cleaner way (to me) than SDL.  It takes less time to set up, I personally find it builds smaller executables (again I have to use other libs with SDL which eats up space), and blah blah whatever.

Blah blah, SFML is good dammit.  Cheesy
Logged

I'd write a devlog about my current game, but I'm too busy making it.
increpare
Guest
« Reply #10 on: May 22, 2010, 01:44:30 PM »

To avoid tearing, all you need is to sync your blits to the VBL (Vertical Sync).  

If you don't do this, your window buffer can get copied to the screen in the middle of copying in the next frame and you get the "tear" effect of part of the current drawing frame overlapping the last frame in the buffer.

Surely SDL can sync its draws to the VBL?
I've tried this extensively with both sdl and allegro, to no success (I ended up blitting to an image each frame, then copying that to texture memory and drawing this) - I remember reading somewhere that most modern graphics cards just ignore software-drawing related vsync commands (I'd like to find a reference, but I don't fancy tracking it down right now).  Vsync also is a problem with flash.
Logged
tapir
Level 0
**


View Profile
« Reply #11 on: May 22, 2010, 01:54:14 PM »

(like audio.)

you can always use SDL_mixer or OpenAL (which is what SFML uses)
Logged
increpare
Guest
« Reply #12 on: May 22, 2010, 01:54:59 PM »

(like audio.)

you can always use SDL_mixer or OpenAL (which is what SFML uses)
That does not address his point in any way shape or form (in fact, it confirms it).
Logged
salade
Level 4
****



View Profile
« Reply #13 on: May 22, 2010, 02:08:14 PM »

To avoid tearing, all you need is to sync your blits to the VBL (Vertical Sync). 

Even if someone has managed to bypass whatever problems increpare is having, it is worth mentioning that vsync is commonly associated with latency. I can never really tell the differnece, but some people get religious over that kind of stuff...

Anyway, I use SDL, but really only because I'm familiar with it and it happens to be suiting my purposes. (I've never tried SFML)
Logged
CyanPrime
BANNED
Level 1
*


View Profile
« Reply #14 on: May 22, 2010, 02:10:05 PM »

(I've never tried SFML)
You owe it to yourself to do so.
Logged

Aquin
Level 10
*****


Aquin is over here.


View Profile WWW
« Reply #15 on: May 22, 2010, 02:33:24 PM »

Yeah, don't get me wrong.  I used SDL for the longest time.  I used SFML *once* and never looked back.  It kinda makes that sort of impact on you.  It was like the first time I used Code::Blocks.

I never understood a lonely nerd's desire to marry his computer until I used that program.
Logged

I'd write a devlog about my current game, but I'm too busy making it.
Akhel
Level 10
*****



View Profile
« Reply #16 on: May 22, 2010, 02:34:57 PM »

As someone who's only used Allegro, what's so good about SFML?
Logged
Aquin
Level 10
*****


Aquin is over here.


View Profile WWW
« Reply #17 on: May 22, 2010, 02:37:31 PM »

As someone who teethed on Allegro, SFML was a big step forward for me.  Hell, the upgrade to SDL was even a bit better.  I'm not too sure how to put it.  It's cleaner, easier to read, and more intuitive?

It's a pretty general feeling.  I think you'd need to read the docs to get a sense of it.

I'm not even sure AllegroGL is even supported anymore is it?  There doesn't seem to be much activity.
Logged

I'd write a devlog about my current game, but I'm too busy making it.
dr.crow
Level 1
*



View Profile
« Reply #18 on: May 22, 2010, 04:30:30 PM »

I'll have to say SFML.

I used SDL for several years until i needed better performance and support for scalable/rotatable graphics. Then i tried using sdl with opengl for some time. I got a incredible boost in performance, and managed to rotate, scale etc, but i found out i was more interested in creating games than reinventing the wheel writing wrappers. So i switched to sfml.

After using sfml for about two weeks i already like it better than sdl. Only thing i fear i'm going to miss is the sdl_mixer and it's support for mods and midis.

I also remember having trouble switching between video modes in sdl. This seems really easy in sfml.
Logged
Cimpresovec
Level 1
*


View Profile
« Reply #19 on: May 23, 2010, 03:45:02 AM »

Well I can only say SDL because I never used SFML. But yea when it comes to bliting in SDL, the CPU usage is huge and the speed is good until you stick to only 50 objects on the screen.

But for the stuff that I use SDL, that's event handling, I have to say it is really great. OpenGL and FMOD do the rest. Oh and I don't think that setting up SDL is hard, you just set up the few libraries and that's it.

Logged

Programming is the closest thing I have to magic.
Pages: [1] 2 3 ... 5
Print
Jump to:  

Theme orange-lt created by panic