Before writing a single line of game code you need an environment that compiles, links, and runs. Let's get it ready in under 30 minutes.
In the previous lesson we talked about what we're going to build. Now it's time to lay the groundwork. We'll use SDL2 (Simple DirectMedia Layer) as our graphics library throughout the course, for three concrete reasons: it's cross-platform (Windows, Linux, macOS), it's low-level — it forces you to understand the game loop, rendering, and input instead of hiding them behind an engine — and it has years of documentation and examples, which helps a lot when your AI assistant needs to give you accurate answers about it.
We won't use an engine like Unity or Godot because the goal of this course is for you to understand the fundamentals of C/C++ applied to games. Once you master this, learning any engine will be trivial.
You need a C++ compiler that supports at least C++17. On Linux, `g++` is the standard choice. On macOS, it's installed along with Xcode's Command Line Tools. On Windows, the simplest option is MSYS2 with `mingw-w64`, or using WSL2 to get a full Linux environment.
Verify it installed correctly:
If you see a version number for both commands, you're ready for the next step.
SDL2 can be installed via a package manager on Linux and macOS, and via MSYS2 on Windows. We'll also install `SDL2_image` (for sprites, which we'll use in lesson 4) and `SDL2_ttf` (for on-screen text, useful for the Pong scoreboard).
Let's write the "hello world" of SDL2: open a black window and close it with the Escape key or the close button.
Compile it like this:
If you see a dark window that closes with Escape, your graphics environment is working.
Starting with the next lesson we'll use CMake so we don't depend on long `g++` commands. This is the skeleton we'll reuse in every subsequent lesson:
Now for the other half of the environment: your AI assistant. If you're using Claude Code, install it from the terminal and run it inside your project folder — that way it has full context of your files, your `CMakeLists.txt`, and your compiler errors. If you prefer Cursor, open it directly on the project folder; its AI integration works on the same principle: context from real files, not isolated code fragments pasted into a generic chat.
The key difference of working this way, inside the project, is that you can ask things like "run CMake and tell me why the linker is failing" and the assistant can read the actual error, not one you transcribed halfway. This is especially valuable in C++, where linker errors (undefined symbols, libraries not found) tend to be cryptic for beginners.
To keep things consistent over the next 11 lessons, use this base structure in every project:
With the compiler, SDL2, and your AI assistant configured and verified, you now have everything you need. In the next lesson we'll use this exact environment to build our first complete game: Pong, step by step, with the main loop, paddles, ball, and scoreboard.
Carlos Montiel is an enterprise AI solutions architect. He implements LLMs, Agents, RAG, and orchestrators for companies across Guatemala and Latin America. Reach out for a consultation.
Contact Carlos Montiel