Biscuit's Cookie Algorithms
3 min readJul 1, 2024

Do not, I repeat, do not learn game development with SDL2

My first game was made in C++, with SDL2, and it taught me a lot about game development. But I realized that I had gone too low-level, too late. I am not saying that I dislike SDL2, or that SDL2 is a bad library, by any means. I mean, there are 700 fully-fledged games that were made with it. This is also not meant to deter you from using SDL2 if you’re passionate about it. But it isn’t good to use if you don’t understand that you have to clear the screen, update, then draw, in a loop.

Reason One: There are a lot of libraries out there that’ll teach you the same fundamentals without all of the setup and configurations that come with installing most C/C++ libraries, because these two languages don’t have a package manager. If you want to learn how to make a game, and learn fast, you don’t want to have to configure this and that file, and then accidentally move it to the wrong place, or maybe you did everything right but your compiler can’t find the header file for some reason, and now you need to figure that out.

Reason Two: Big game development studios don’t use raw SDL2, to make their games, they’ll instead either build an abstraction on top of it or use a commercial engine like Unity, so your SDL2 experience might not matter as much on a portfolio. Don’t get me wrong, programming games from scratch is an amazing way to learn and I do it myself. My most recent game is being made with the Java standard library. But from my knowledge most big game development studios will either use Unreal, Unity, or their own in-house engine. Do game engines use it? Yes, but a game engine developer isn’t going to want to see your crappy Earthbound clone made in SDL2 when you’re applying for a job.

Reason Three: The documentation. This is a pitfall of a lot of documentation websites, actually; they’ll tell you what something is, maybe what it does or what it’s supposed to do, but they won’t tell you how to use it, which is probably what you came to the website for. I’m talking about the official site, not third parties like LazyFoo. For example, a way to detect key presses in SDL2 is to use SDL_Events. You might see on the documentation that SDL_Events can be used to detect key presses, joysticks, what have you — but you might not understand just by looking at the SDL_Event page on the official website that you’re supposed to check if the user pressed the X button by checking for SDL_QUIT, or that you’re supposed to use SDL_PollEvent in a while loop to check if the player is even interacting with the game, or that to detect key presses you use a switch statement that checks for “SDL_Event.key.keysym.scancode” inside of an if statement that checks if the SDL_Event type was SDL_KEYDOWN.

The final reason you shouldn’t learn game development with SDL2 is that SDL2 is not plug-and-play like a lot of game engines are. It’s essentially too much power. You probably don’t need raw SDL2 to make your video game. Yes, SDL2 gives you a lot of power and control over the computer, but if you’re trying to create a Pong or a Flappy Bird clone, you don’t need such power and strange configurations that come with the average C++ library. And because you aren’t using such power, all the things you have to do before you can simply draw a square to the screen will become apparent. Yes, having a lot of power and control is useful — if you’re creating the next Stardew Valley. Stardew Valley wasn’t even made in C++, it was made in C#, furthering my point.

All in all, SDL2 is good. It’s great. Just don’t use it to learn if you don’t know how a game loop works. That’s why we have Pygame and Raylib.

Biscuit's Cookie Algorithms
Biscuit's Cookie Algorithms

Written by Biscuit's Cookie Algorithms

I am a game developer who wants to document the development of his games, and also gather support for them.

No responses yet