Hello guys,
I've been doing c++ programming for about three years and I just entered the world of game programming. I'm having some trouble with choosing a good API (or a framework?) for doing game programming on OS X with c++. I did some research on available APIs and I usually see this two things pop up: SFML and SDL. I've tried SFML and made a few programs easily but I have no any idea with SDL. But then I just noticed that many games seems to be made with SDL instead of SFML like Proteus. So I just can't decide to use which API.
Thanks a lot guys!
(I searched this topic up in the forum and all the posts that came up are pretty old, around 2010, which I don't think will be pretty useful because there are many new changes to both APIs.)
It depends on you. According to their features and portability, they're very similar. However, SFML is based on classes. SDL isn't, so you must either work with pointers (lots of pointers) or create classes on your own (which is, by the way, quite entertaining).
You can choose whatever you want. SFML is more novice-friendly, but both libraries are great in the long run.
I'll give my vote and say SDL2. I enjoy it because I can write both C or C++ code with it, and not feel like my code base is an entire mess. I've tried SFML and without going into any detail why, I don't care for it.
So SDL2 gets my vote. The fact that it's supported by Valve is a bonus, for non-technical reasons of course.
If you're looking to jump into gameplay programming without a lot of the surrounding fluff, I'd actually go with Unity and C#. It's flexible enough to do most things.
If you want to stick with C++ or are interested in some lower-level graphics stuff, I'd go with an OpenGL + GLEW/GLFW setup (and I'd pull in the likes of GLM for helpful math stuff).
I have no real opinion on SFML vs SDL - just throwing in some alternatives.
Guys, does SDL supports object oriented programming? I heard it's written in C (which doesn't supports OO), but I heard it's also compatible with C++. Just a question: does C supports OO? (I know its quite silly) By the way, I don't really like pointers. I just don't like all those memory address stuff. Are pointers really useful?
I just found more and more games made with SDL, and non of them were made with SFML. Why is SDL so popular or I'm just not looking at the right place and there are actually games with SFML?
It doesn't matter all that much that a bunch of games are made with a certain framework. There are a bunch of reasons why one framework may be more widely adopted over another. Developer preference of APIs might be high up on that list.
Sounds like you're keen on either one of these, so my advice is to try both. See which you prefer.
Unturned wrote:
does C supports OO?
Yes, it's possible (though not entirely intuitive) to write OO code in C.
If you spend three days deliberating which engine to use without dipping your toe in the water I can guarantee that your game will never see the light of day.