SDL - waste of time?

Started by
8 comments, last by Alundra 11 years ago

Hello

I am using SDL to learn basics of the game industry, however I will want to move to 3D games in the future. I think, that in this case, SDL is a waste of time. Won't it be better to use OpenGL or DirectX to learn the 2D games? Moving to 3D wouldn't be so hard because I would already know the library. On the other side, I am afraid that they may be too hard for the beginner. Should I keep using SDL and then learn DirectX or OpenGL from the very beginning or learn one of them right now?

Advertisement
OpenGL and DirectX are (essentially) just APIs for interfacing with the GPU. Leaning one or other is no great challenge in principle, it only really becomes difficult and problematic when people dive in with little or no mathematical understanding of the concepts behind the APIs (in my opinion). "Learning" the DirectX/OpenGL APIs certainly does not equip oneself to use it, when working at such a low level you need to have a good handle on the math to do anything useful without it becoming a frustrating teeth pulling exercise.

So would SDL be a waste of time? Well, it depends on what you know and what you want to learn. Using SDL and DirectX/OpenGL are not mutually exclusive, I haven't used it myself (so take what I say with a pinch of salt) but from my understanding SDL is (amongst other things) a quick and simple means of getting a window up and running for rendering on whatever platforms it supports. DirectX/OpenGL alone do not replace frameworks such as SDL as they are only concerned with interfacing with the GPU, not creating windows, playing sounds, handling networking and so on (I'm not a DirectX user myself but I believe earlier versions did come with a framework to handle a lot of the boiler plate stuff like window creation, resource loading etc. but I'm not sure if that's the case with the latest version).

In my opinion, I'd stick with SDL for the time being and focus on getting stuff done rather than fretting about hypotheticals. There's nothing to say you can't learn SDL and then move onto something else in the future, it certainly won't be "wasted" time if your using it to get valuable game-making experience.

A professional can use a calculator to perform division, but that doesn't mean that they shouldn't be taught how to do long-division by hand still.

A rocket scientist building a solid-oxygen booster hasn't wasted his time if he first practiced on model rockets and soda bulbs -- it may in fact have been a key stepping stone to getting where they are now.

In your professional career you might not use SDL, but that doesn't mean it's a waste of time to practice with it in the meantime. SDL greatly simplifies a lot of the complex and boring parts of multimedia work so that you can initially focus on programming interesting and useful apps. Once you're comfortable programming simple SDL games, and feel like exploring, then push it aside and try and make similar games without it, for the challenge.

Also, SDL can be used in conjunction with OpenGL, so if you feel like learning OpenGL soon, then the transition can be extremely smooth - you can actually be using both at once.

Think of it like a learners bike -- you don't get a 2000cc motorbike straight after getting your license, or you'll end up frustrated and hurt cool.png Much better off getting something simpler and easier to control until you're comfortable with it.

In fact, a truly seasoned professional programmer will be expected to be able to be given a new API, like SDL, and learn and start working with it in just one day. So practicing on many, many different APIs (and practicing the process of learning how to use new tools) is extremely important. As a professional, you'll need to be able to learn absolutely foreign tools, which you may only use once and never again, all the time.

Um, I believe one of the most common use cases of SDL is for window creation and input management while leaving graphics to OpenGL.

There is a lot more to building games than the graphics. Building smaller games, even 2D sprite based games, will teach you a lot of the things you'll need to know when you want to make larger games in future. Nercury's point is a good one too, even if SDL isn't used for drawing it is still an excellent API for getting the screen up and input working, and then staying out of your way if you want to use raw OpenGL calls.

SDL has the use case that it can wrap various OS APIs, giving the option to avoid some of this and also help increase portability.

for example, some code can be written, and avoid needing to have explicit per-OS code for things such as setting up the drawing window or dealing with user input or sound output or similar.

otherwise, a person will need to write a lot of this code themselves.

granted, for something like a Windows-only DirectX app, it wont necessarily gain as much here.

SDL is pretty good, especially the new one. Also you may want to look into SFML 2.0, it does the same jobs as sdl but its object oriented, and very well designed.

If this post or signature was helpful and/or constructive please give rep.

// C++ Video tutorials

http://www.youtube.com/watch?v=Wo60USYV9Ik

// Easy to learn 2D Game Library c++

SFML2.2 Download http://www.sfml-dev.org/download.php

SFML2.2 Tutorials http://www.sfml-dev.org/tutorials/2.2/

// Excellent 2d physics library Box2D

http://box2d.org/about/

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

I've used SDL for two project game engines that use OpenGL for graphics. The upside of SDL is that it is highly portable, and has builds for just about every platform you can think of.

SFML is very nicely structured and organized, but isn't supported on many platforms (yet).. It's not even strictly C++, there is a C version (you have to dig a little on the site) for those who prefer it.

This sounds like a case of making big decisions of little consequence. It really doesn't matter what you do at this point, because you have a long way to go. But you will have to do something in the meantime, to gain all the knowledge and experience it takes to make decisions that will affect real projects that have a real affect on your life.

Don't look so far ahead, because it doesn't matter until you get there. Learn everything you can in the meantime. In my experience, even tangent projects that have nothing to do with making games will teach you something that you can use as a game developer.

I started programming as a kid because I wanted to make games. That was almost 20 years ago. I've made a few game projects that have grown bigger and more involved each time, but I am *just now* working on my first real indie game.

Don't stop programming, whatever you do. That's what you have control over right now that will matter in a decade.

Um, I believe one of the most common use cases of SDL is for window creation and input management while leaving graphics to OpenGL.

It is, leave rendering to OpenGL and everything else to SDL - although now SDL has some functionality for rendering 2D graphics with hardware acceleration, so maybe OpenGL can be avoided with some kinds of games (SDL will use whatever it thinks is best, going with software rendering only as a last resort).

Also Valve is using SDL now, if that matters.

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

You can use SDL for the unix version to handle window and input.

Quake4, Unreal Tournament, Unreal Tournament 2003, Unreal Tournament 2004, and many other do that.

You can change the window/input code after, SDL is here to make you winning time.

This topic is closed to new replies.

Advertisement