Question: is SDL a good choice for getting into 2D?

Started by
6 comments, last by Dante12129 10 years, 9 months ago

After working on some key concepts in a text-based game, me and two other friends are about to carry on our plan of making games together. We spent a lot of time educating ourselves and each other on the very basics. But since I'm the most 'experienced' of the team, I wanted to ask a question about which direction would be good to follow.

After some research, I found SDL to be a good choice for a first contact with 2D game development. I have my hands on a pretty good tutorial series from lazyfoo.net and the library seems both capable and easy to work with for a first-timer. The thing is, as a newbie, I feel lost in the jungle of different tools. possibilities, and paths to take. So, do you think that sticking with this particular tool and making a few projects with it teaches things that we can use to go ahead to more advanced stuff - like, say, using DirectX? Or do the concepts taught in each library/engine differ across tools?

Thank you!

Advertisement

Yes, for someone who already know C/C++, SDL allows to create game prototypes very fast and very easily. If you remove the OpenGL wrapper portion, pretty much the only operation you can do with SDL is copying (blitting) rectangular surface on each other and on the screen (with the possibility of basic blending) using hardware-acceleration. There's also SFML which I never tried but is worth looking into because it allow for other shapes geometry than rectangles. They also contain some functions to setup a window and read inputs and such.

DirectX allows for much more control of everything. You can use different projections, shaders and much more to create multiple effects. On the other hand, it is harder to setup and you need a really high dedication and time to learn everything needed to use it correctly and for a beginner it can be unpleasant.

As far as the rendering technique goes, learning SDL won't make learning DirectX/OpenGL easier. SDL is pixel-based while DirectX is vector graphics. But for everything else related to game programming other than the graphics, it's good exercise.

Those are both graphic only APIs for C++. Learning them alone won't directly help you make a game since a game is much more than that. Learning these will make you a graphic programmer, not a game programmer. I think most people here will tell you to concentrate on making a game, not game engine. They will tell you to use existing engines like Unity and scripting languages or higher level language like Python or C#. The decision is up to you.

SDL is a fine choice. It provides everything you need to get a 2D game up and running. If you go with SDL 1.2, there are plenty of tutorials out there to help you get going. I like SDL 2 better, but there isn't a lot of info out there at the moment for people just starting out, so you might have a tough time getting started with it. SDL 1.2 coupled with the lazyfoo tutorials will be great to get your feet wet and will make it easier for you to pick up SDL 2 later on.

As to DirectX or OpenGL, I would recommend that you examine your priorities. When the goal is just to make games, you really won't need to touch either API unless you get to a point where existing libraries/engines/frameworks can't provide the features you need. Put your effort where your interest lies.

Wait, so SDL 2 == SDL 1.3 and it was released as non-Beta, etc.?

When did this happen?

jwezorek: Actually, it seems it's still a release candidate (even though they call it stable). The only reason I knew about this was this Reddit thread from 2 weeks ago that link on this SDL webpage that looking more carefully don't seems to be linked anywhere on the official site.

jwezorek: Actually, it seems it's still a release candidate (even though they call it stable). The only reason I knew about this was this Reddit thread from 2 weeks ago that link on this SDL webpage that looking more carefully don't seems to be linked anywhere on the official site.

They call it stable because it is! The API was locked at the end of April. The RC process is just to make sure there's no lingering bugs before they make an official release. I've been using it for several months now, even before the API was locked down, and haven't had any problems with it. IMO anyone making new games right now with SDL should prefer SDL 2 unless they have a specific need for 1.2.

SDL is fine, but be sure and check out SFML as well. I like it much more than SDL, after using both of them.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

I agree with BeerNutts about SFML. It has a cleaner, OO interface and you don't need a bunch of addon libraries (or your own code) to do simple things like non-rectangle shapes, text, audio, and networking.

This topic is closed to new replies.

Advertisement