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

Started by
11 comments, last by georger.araujo 9 years, 10 months ago

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 :)

Advertisement

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

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.

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.

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.

~GTE

Thank you for your answers! :)

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

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

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

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

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.

This topic is closed to new replies.

Advertisement