Beginning Game Programming v3.0
Last Updated: Jun 8th, 2025
Hey, you're not supposed to be here 😉.Anyway, you are currently looking at the pre-alpha version of the SDL3 tutorials. This page will become fully public once SDL3 and SDL3_image/SDL3_ttf/SDL3_mixer have their first official stable releases. An official release of this tutorial will have to wait until all the SDL3 libraries used in this tutorial set have their first official releases. If you want more SDL3 code to play around with, check out the SDL3 ports at the bottom of each page of the SDL2 tutorials provided by the creator of SDL Sam Lantinga.
Once all the SDL3 libraries officially released, I'll give these a clean up (as they were a bit rushed) and release set up tutorials. Until then, SDL2 should suit what you need. Your project's code will not explode once SDL3 is officially released and porting from SDL2 to SDL3 is relatively straightforward.
At time of writing SDL3, SDL3_image, and SDL3_ttf have official releases but SDL3_mixer is not officially released yet. There are changes being made to the final API and that might cause tutorial code to break. These tutorials have been tested on SDL3_mixer sha version daf0503cea6d9a521f585d37e785d88c2f066cd0 and newer versions will likely break the tutorial in case you run into issues. I plan on having them fixed when the official release is out.
These tutorials were designed for beginner C++ programmers (with some stuff thrown in for the more experienced) who want to move from text based applications to real time games with graphics. By the end of these tutorials, you'll know the basics so you can really start digging into lower level game programming.
Table of Contents | |
---|---|
Introduction |
A little intro before we start coding. |
Hello SDL3 |
Get started making games with your first SDL3 App. |
Textures and Extension Libraries |
Load PNGs and render textures. |
Key Presses and Key States |
Learn how to handle keyboard input. |
Color Keying |
Give your textures transparent backgrounds. |
Sprite Clipping and Stretching |
Clip sprites from a sprite sheet and resize them. |
Rotation and Flipping |
Learn to rotate and flip your images. |
Color Modulation and Alpha Blending |
Modify your texture colors and make your images transparent with alpha blending. |
True Type Fonts |
Render True Type fonts with SDL_ttf. |
Mouse Events |
Learn how to handle mouse input. |
Timing |
Learn the basics of application time. |
Advanced Timers |
Make a timer that can start/stop/pause/unpause. |
Frame Rate and VSync |
Learn how to manage frame rate. |
Motion |
Learn how to manage frame rate. |
Animation |
Learn to animate a sprite. |
Sound Effects and Music |
Play music and sound effects with SDL_mixer. |
Collision Detection |
Learn how to check collision between collision boxes. |
Text Input and Clipboard Handling |
Input strings and handle copying and pasting. |
Scrolling |
Draw levels larger than the screen with a scrolling camera. |
State Machines |
Manage your game states with state machines. |