Jump to content

  • Log In with Google      Sign In   
  • Create Account

Which will be better for a beginner, SDL, SFML or OpenGL?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 sn0k3   Members   -  Reputation: 165

Like
0Likes
Like

Posted 01 June 2014 - 04:34 AM

Hello guys! smile.png

I want to make games.For now simple 2D games, but I don't know from where to start. I "know" C++, but i havent worked with classes.I want to begin with game development and I searched in the internet so there are 3 librarys SDL, SFML and OpenGL.As I said i'm beginner, so my question is - which is better to begin with and why?And also what should I know to begin? Thanks :)


Edited by sn0k3, 01 June 2014 - 04:35 AM.


Sponsor:

#2 Jan2go   Members   -  Reputation: 796

Like
9Likes
Like

Posted 01 June 2014 - 05:14 AM

First of all, OpenGL is different from SDL and SFML. While OpenGL is an API for 2D and 3D rendering, SDL and SFML are libaries that offer you (easy) access to audio, input, graphics, the windows system (not exclusive).

 

Also, if you haven't worked with classes yet, you don't "know" C++. Classes are probably the most important concept of object oriented programming languages like C++. I would highly recommend to start with learning these basic concepts before diving into game development, if you want to use C++.

 

As I haven't used SDL and SFML so far, I can't tell you which of the two is "better". I survived without both of them, even though it might have been quite nice to create a window in less than 100 lines. :D



#3 Aldacron   GDNet+   -  Reputation: 3180

Like
6Likes
Like

Posted 01 June 2014 - 05:56 AM

For 2D games, you can do well enough with either SDL or SFML. Both have an accelerated 2D rendering API that uses OpenGL under the hood (SDL can also use DIrect3D). If you use OpenGL directly, you'll still find SDL, SFML, or something else (like GLFW) useful to abstract the platform away and make it easier to create the game window and deal with system events, but you'll be implementing your 2D renderer from scratch. Since you're just starting out, implementing your own renderer isn't likely a great way to go right now. Just pick one of SFML and SDL (or even Allegro) and go for it.



#4 radioteeth   Prime Members   -  Reputation: 1051

Like
0Likes
Like

Posted 01 June 2014 - 06:10 AM

OpenGL is just an API to talk to your graphics hardware - for rendering.

SDL and SFML are libraries which act as an abstraction layer between your program and the operating system.



#5 GearTreeEntertainment   Members   -  Reputation: 381

Like
0Likes
Like

Posted 01 June 2014 - 07:20 AM

If you are looking to make 2d gamea you arw not going to use opengl unless you want to complicate things. As for SDL and SFML I havent ever used sfml but I use sdl. I was able to make my first game in sdl only a week after I started learning it.

I'm da almighty Gear


#6 sn0k3   Members   -  Reputation: 165

Like
0Likes
Like

Posted 01 June 2014 - 09:00 AM

Thank you for your answers! :)



#7 Hauck   Members   -  Reputation: 219

Like
0Likes
Like

Posted 01 June 2014 - 10:05 AM

I had my very first experience with game programming using SDL. It has a lot of useful tutorials for beginners around the internet. I can't talk about SFML since I've never used it, but I did pretty well with SDL and learned the basics with it. smile.png


Edited by Hauck, 01 June 2014 - 10:06 AM.


#8 Misantes   GDNet+   -  Reputation: 879

Like
4Likes
Like

Posted 01 June 2014 - 12:15 PM

I just thought I'd jump in since no one else had used sfml and throw my vote in for that tongue.png I found it extremely easy to use and get familiar with. Personally, I'd suggest trying out both and seeing which you're more comfortable with. I had some issues with SDL(though it's been awhile and don't recall what tongue.png) and ended up with sfml. I never had any problems with it and was extremely pleased with the library overall.

 

I think the SFML vs SDL question is one of those entirely subjective questions, unless you're asking for a very specific reason or need a very specific thing from your library. They both have their pros and cons and you'll alwyas get 10 different answers from 10 different people. So, unless you had specific requirements of your library, I'd suggest flipping a coin, or even better, just installing both and seeing which tickles your fancy smile.png

 

As mentioned above, opengl isn't recommended or necessary for simple 2D games. There are things you could use it for, but as someone who is currently learning opengl, I suggest staying the hell away from it for awhile until you're really comfortable with making 2D games. It's taken years off my life :P


Edited by Misantes, 01 June 2014 - 12:22 PM.

Beginner here <- please take any opinions with grain of salt :P


#9 madgod_zhar   Members   -  Reputation: 176

Like
1Likes
Like

Posted 01 June 2014 - 01:46 PM

ill throw in a vote for SFML. i asked this question a few weeks back and decided to go with SFML, i haved tried SDL yet, but ive loved SFML so far, all ive managed is a simple tick tack toe game so far. but im liking it so far, the real downside wit SFML is i would say there are fewer good tutoraials out there. if you want i could try and help you with what little i know! though im probably hardly better off than you are



#10 dejaime   Crossbones+   -  Reputation: 4027

Like
4Likes
Like

Posted 01 June 2014 - 02:48 PM

SDL is procedural and completely based on C, you would need to work around this if you want to use object orientation.

SFML on the other hand is Object Oriented, so you'd need to work around this if you don't want to use object orientation.

 

I have used both and prefer the way SFML handles most things. But my experience with SFML is limited as I still use SDL mostly because most of my "reusable code" was crafted with SDL, and this alone is a giant reason for me to stick with it. There is also the fact that SDL is bigger, meaning better community help, more examples/tutorials, better maintenance and stability (not really counting SDL_Mixer and SDL_Image here though)...

 

I plan on using SFML for some projects though, and verify whether my first impressions were correct or not.


Edited by dejaime, 01 June 2014 - 05:41 PM.


#11 georger.araujo   Members   -  Reputation: 817

Like
0Likes
Like

Posted 02 June 2014 - 02:41 PM


SFML on the other hand is Object Oriented, so you'd need to work around this if you don't want to use object orientation.

SFML has an official C binding.



#12 dejaime   Crossbones+   -  Reputation: 4027

Like
0Likes
Like

Posted 02 June 2014 - 02:50 PM

SFML has an official C binding.
As SDL have several java bindings. But they are still workarounds.

#13 georger.araujo   Members   -  Reputation: 817

Like
-1Likes
Like

Posted 02 June 2014 - 03:09 PM

 

SFML has an official C binding.
As SDL have several java bindings. But they are still workarounds.

 

 

The C binding of SFML is not a workaround. As per the site, it is an official binding maintained by the project founder himself, along with SFML.Net. I couldn't find any official binding for SDL.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS