#1 Members - Reputation: 116
Posted 01 July 2012 - 01:56 PM
I have been programing c++. I would like to start programming games and I heard that SFML and SDL would be good to start and to do great games, but witch one should I use. I also would like to ask for good tutorials for SDL and SFML.
Thanks.
#2 GDNet+ - Reputation: 5613
Posted 01 July 2012 - 02:57 PM
So I'll answer it the same as I've always answered it: I'd say go with SFML 2.0. It's great. It's got tutorials written by its author (he's still writing more) (SFML 1.6 tutorials can be used and pretty easily converted to SFML 2.0 while the author is still working on more 2.0 tutorials). SFML is incredibly simple and intuitive to use, I've found, and it's got good forums for support and questions. The main reason I say SFML, however, is that it's written in C++ and you're using C++, so it just feels more intuitive to use. If you used SDL, it's written in C, and mixing C and C++ is just fine if you know what you're doing, but if you're still learning C++ (which I'm assuming you are) you might get some C habits mixed in your C++ habits, which isn't the best way to learn things.
If, at the end of the day, you still can decide, flip a coin. The time you spend debating between one or the other is better spent just learning one.
#3 Members - Reputation: 206
Posted 01 July 2012 - 05:02 PM
Canvas
#4 Members - Reputation: 200
Posted 01 July 2012 - 06:00 PM
I'd still go for SFML because it's easier to use, and the things that SDL supports and SFML doesn't (like multiple windows) are generally not needed.
#6 Staff - Reputation: 8994
Posted 01 July 2012 - 06:54 PM
Both APIs are very capable, and the core functionality is very similar (and as noted above, the latest version of SDL does use hardware rendering like SFML where possible) although you'll probably find that due to it's age there are more add-ons for SDL ('though due to their age some of them may not be currently maintained!
It mostly comes down to personal preference: I'd recommend taking a look at some of the tutorials and reference materials available for each API and choosing whichever makes more sense and looks like a better style to you.
All that being said, if you would like our suggested preferences, I personally prefer SFML -- I just felt the topic was a bit one-sided thus far and that SDL should also be properly presented as a viable choice, as both are capable APIs that you should be able to learn without undue difficulty. It's worth quickly noting also that due to the similarity of these (and other similar) APIs, if you learn either of them in detail you should find it relatively easy to learn the other at a later stage should you choose to do so.
Hope that's helpful!
- Jason Astle-Adams.
From my blog: 20 ways to advertise your game | What next? Intermediate to advanced C++
How to make games WITHOUT programming | 4 reasons you aren't a successful indie developer
#7 Members - Reputation: 191
Posted 01 July 2012 - 07:31 PM
To be honest I started a project with C++ and SDL, was going perfectly until sprite rotation. SDL isnt friendly with sprites to be honest, and as it uses the CPU only and not the GPU it isnt very good to do the rotation on the fly, as it could cause major lag on many machines, If you want to create a quite simple basic game or program I would say go for SDL as it is nearly supported by everything, If you want something that uses the GPU and doesnt cause a huge amount of process to the CPU go for SFML. I converted all my SDL project to SFML in a very short time, and as I have worked with SDL before I feel that SFML is much easier and well...just easier to understand.
Canvas
Actually, you can mix OpenGL and SDL for hardware acceleration. (Someone correct me if I'm wrong). Basically you would use SDL_opengl.h for SDL's OpenGL functions.
Anyway, for simplicity and moderate portability, go SFML.
For massive portability and moderate difficulty, go SDL.
I haven't really used SFML, I just really found out about it yesterday in fact. It's really simple, or maybe I say that because I've been working with OpenGL and SDL for a while now. I personally strongly recommend SDL, as it's well matured and it has great portability. It's also a great starting point for understanding how some of the behind the scenes magic works. To me, SFML's weakness is its simplicity. That's just my personal opinion, I like being able to see what I'm working with and make it work for what I want it to.
I may not be the best guy to get an opinion from as I did just find out about SFML yesterday, but I did test it and got it to work no problem.
Edited by Spirrwell, 01 July 2012 - 07:32 PM.
#9 Staff - Reputation: 8994
Posted 01 July 2012 - 09:41 PM
Pretty unlikely given the OP specifically mentioned C++ and hasn't made mention of C...There is a C variant of SFML if you dig around on the SFML-dev.org website, so you're not forced into incorporating C++ code into your project if that's your intent.
- Jason Astle-Adams.
From my blog: 20 ways to advertise your game | What next? Intermediate to advanced C++
How to make games WITHOUT programming | 4 reasons you aren't a successful indie developer
#10 Members - Reputation: 269
Posted 02 July 2012 - 02:46 AM
SFML has too many 'nifty' tools that I never use. It has the aim of being more of a helper library and tend to seep in everywhere. It just imposes itself a bit too much for my taste. The api is pretty OK for what it is though and most people doesn't want to get their hands gritty with opengl calls the way I do..
The many nifty things that it includes are indeed nifty, but they're usually not as versatile as if you'd get another specialized library for the specific purpose. It has network sockets for instance, which is nice and all, if you want something really simple in that way, but they are fairly limited.
If you need the easy basics of rendering a 2D game you should go for SFML. But if you're like me and want to try a few more advanced techniques on your own and rather not have anything in your way, I'd say SDL because it's just there silently in the background.
#11 Members - Reputation: 239
Posted 02 July 2012 - 02:22 PM
I've found it remarkably easy to use SDL, the only thing I've come across that it doesn't do (so far) is rotation. I'm sure if I played around with the OpenGL side though I could nail that down. Lazy Foo has a tutorial for everything that you could need and each one has working sourcecode that you can run and see working and interrogate to make changes and see how they impact the output. I really can't praise the man enough.
#13 Staff - Reputation: 8994
Posted 02 July 2012 - 10:59 PM
I just thought I'd quickly note that you can also use SFML in the same way -- and in the C++ spirit of "only paying for what you use" it's typically built as a series of separate components (some of which rely on each other) so that you can choose to only link against the functionality you're actually using.I'd say SDL because it's just there silently in the background.
@Greemax:
Great, glad we could be of help making your decision, good luck with it!
- Jason Astle-Adams.
From my blog: 20 ways to advertise your game | What next? Intermediate to advanced C++
How to make games WITHOUT programming | 4 reasons you aren't a successful indie developer






