Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SDL vs. SFML  (Read 14113 times)

0 Members and 1 Guest are viewing this topic.

Yours3lf

  • Newbie
  • *
  • Posts: 43
    • View Profile
SDL vs. SFML
« on: April 11, 2011, 08:33:17 am »
Hi everybody,

I've heard lots of great things about SFML, and I also experimented with it.

my question is, when using it for nothing more than input and window handling, and creating an OpenGL context (and using OpenGL for rendering) is it faster than SDL?

(I'm not curious about the two libraries' own 2D drawing performance.)

my other question would be, does it provide OpenGL context profiling like FreeGLUT does?

(I mean, can I specify that I only want the core context to be present?)

Best regards,
Yours3lf

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SDL vs. SFML
« Reply #1 on: April 11, 2011, 08:50:10 am »
Quote
my question is, when using it for nothing more than input and window handling, and creating an OpenGL context (and using OpenGL for rendering) is it faster than SDL?

Windowing doesn't consume a relevant part of the overall performances, so you don't even need to ask this question, it really doesn't matter.

Quote
my other question would be, does it provide OpenGL context profiling like FreeGLUT does?

Not yet, but in a future version it should be available.
Laurent Gomila - SFML developer

walter80

  • Newbie
  • *
  • Posts: 1
    • View Profile
SDL vs. SFML
« Reply #2 on: April 13, 2011, 03:03:30 pm »
Well, from a very, very cursory search, it sounds like SDL uses software rendering, as opposed to the OpenGL-based hardware acceleration SFML uses, as well as omitting several useful APIs. It's also supposed to be Object-Oriented, meaning that you'll have to write cleaner code to get it to work, but you'll also run into less headaches working on it. In the world of APIs, newer tends to mean "more evolved for current usage," along with "doing things made impossible previously by physical or mechanical constraints." I wouldn't say hardware acceleration is "some way," I'd say that, if you knew how to use SDL, and could move to SFML, it would probably make your game faster, easier to code, and less likely to cause you headaches from "gotchas."

In other words, faster, simpler, and cleaner, is what I've been seeing. It's also under active development, too, so unless you have need for a large development community to help you, SFML should have sufficient advantages to make SDL the less desirable option.

Yours3lf

  • Newbie
  • *
  • Posts: 43
    • View Profile
SDL vs. SFML
« Reply #3 on: April 13, 2011, 06:39:58 pm »
I asked because I did have problems with SDL in the past, but the great community at sdltutorials.com helped me out, and since then I didn't encounter any problems with it.
Another reason I asked this is because I want to teach engine programming for beginners, and I wondered if SFML was easier would it be better to show it to people instead of SDL's old fashioned way.
To add, after creating the SDL context, there is no other problem with it, since I don't intend to use it for anything else, and creating the context is real easy even with SDL.

Quote
it sounds like SDL uses software rendering, as opposed to the OpenGL-based hardware acceleration SFML uses


That is right but as I said:
Quote
I'm not curious about the two libraries' own 2D drawing performance.


Edit: specifying OpenGL context profiles would be the only reason I'd move to SFML, because I'd use other libraries for audio, networking, image loading etc.

Best regards,
Yours3lf

Unseen Machine

  • Newbie
  • *
  • Posts: 8
    • View Profile
IRRLICHT
« Reply #4 on: April 17, 2011, 01:31:24 am »
Try IRRLICHT (usable in C++, FreeBasic and QB64 (i have yet to finish the FreeBasic to QB64 wrapper conversion, but a lot of it works.) and many more platforms (i think someone maanegd to link it to SFML aswell)) It has 2 software renderers and supports OpenGL and direct x 8 and 9. It also has built in support for loading and displaying animated and static 3d models, maps and input controls as well as standrad opengl commands.

Yours3lf

  • Newbie
  • *
  • Posts: 43
    • View Profile
SDL vs. SFML
« Reply #5 on: April 30, 2011, 09:46:22 pm »
is IRRLICHT some sort of wrapper for the APIs?

btw I want to teach pure OpenGL, and I posted this topic, because I want to focus on OpenGL not creating a window and messing around with it. this is one of SFML's great advantages.

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
SDL vs. SFML
« Reply #6 on: May 07, 2011, 09:19:51 pm »
As Laurent said, Windowing and Event handling consumes only a completely negligble part of performance on any system that was built in the last 10 years.

If you're teaching OpenGL using C++, you should definitely use SFML since it has a much clearer and easier to use design.

nhnaaldaia

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • http://www.zaptechsolutions.com/
SFML 1.4+
« Reply #7 on: May 11, 2011, 08:22:44 am »
I stumble upon SFML and like what it offered:
SFML 1.4+
- OpenGL hardware accelerated image and text drawing with scaling and
revolution!!!
- Does everything else too, tune, jingle, input, timing, etc
After making several games with both SDL and SFML,

I can honestly not say which is better...

If you have the time and are interested, I recommend you take a look
at SFML:
(www.sfml-dev.org )

That’s all I have to say... :)
software developer in Software Development Company

Yours3lf

  • Newbie
  • *
  • Posts: 43
    • View Profile
SDL vs. SFML
« Reply #8 on: May 12, 2011, 05:10:53 pm »
@nhnaaldaia

thank you for the recommendation. I already have took my time, and have learnt SFML, and I'm using it, and I'm quite convinced.

Quote
I can honestly not say which is better...


I agree, however I felt like SFML gives you more freedom in terms of how you connect to it (inheritance etc.), but this is related to the library being object oriented.

jeetee

  • Newbie
  • *
  • Posts: 2
    • View Profile
SDL vs. SFML
« Reply #9 on: June 01, 2011, 09:09:28 am »
On a related note: we are currently starting a new small game and intend to use SFML for the major part (if not all) of it.

The latest stable is 1.6, but from browsing the forums it seems it is no longer supported and a bit out of date. At about half of the bug/error-reports it is advised to move on to SFML2.
But then again, how stable is SFML2? It is not yet released and it seems some major changes are still being put in..

Which one is advised in terms of development-stability?
Thanks
2 + 2 = 5, within a large range of 2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SDL vs. SFML
« Reply #10 on: June 01, 2011, 09:14:25 am »
Definitely SFML 2. It's just one (or two) major feature away from the public release, the only thing that you have to take in account is that the graphics API will change a lot.

But otherwise it's already robust enough (more than SFML 1.6).
Laurent Gomila - SFML developer

jeetee

  • Newbie
  • *
  • Posts: 2
    • View Profile
SDL vs. SFML
« Reply #11 on: June 01, 2011, 01:50:14 pm »
We'll go with SFML2 right away then.

Thanks for the swift response!
2 + 2 = 5, within a large range of 2

henrikno

  • Newbie
  • *
  • Posts: 8
    • View Profile
SDL vs. SFML
« Reply #12 on: June 07, 2011, 11:00:37 pm »
I have used SDL for a long time, before I found SFML.
Actually, I made a wrapper for SDL in C++, to make it easier to use, which looked a lot like a small part of SFML.

AlexM

  • Newbie
  • *
  • Posts: 18
    • View Profile
SDL vs. SFML
« Reply #13 on: June 11, 2011, 01:04:52 am »
Quote from: "Yours3lf"
is IRRLICHT some sort of wrapper for the APIs?

btw I want to teach pure OpenGL, and I posted this topic, because I want to focus on OpenGL not creating a window and messing around with it. this is one of SFML's great advantages.


Try using Qt. Setting up an openGL window is a snap.

Yours3lf

  • Newbie
  • *
  • Posts: 43
    • View Profile
SDL vs. SFML
« Reply #14 on: June 11, 2011, 09:50:22 am »
i tried and it was nice, really easy to set up i still use it for some projects

 

anything