Lazy Foo' Productions

SDL Forums external link SDL2 Tutorials SDL3 Tutorials Articles OpenGL Tutorials OpenGL Forums external link
Follow BlueSky Follow Facebook Follow Twitter Follow Threads
Donate
News FAQs Contact Bugs

Beginning Game Programming v3.0

Last Updated: Mar 30th, 2026

Welcome to the worst kept secret in SDL development. Remember to check your sitemap generation code before deploying, kids.

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.

This tutorial set is still under construction. 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.

Update for the new year: Guess who has an SDL tutorial website and is currently funemployed? This guy.

Currently, I am not in any immediate financial danger (but oh boy does unemployment not go far enough), but this means two things:
  1. I have to focus on getting a job and which means I am going to put this site on the back burner. I am planning put a coat a polish on the tutorials and post set up tutorials, maybe post an article or two, but after that I will have to halt tutorial development until I find a new job.
  2. Any and all donations are appreciated.
In terms of what I have left before officially publishing these tutorials:
  1. I have to test them on all the platforms I'm supporting (Windows x64, Linux x64, MacOS x64/Arm, iOS, and Android). They have been tested Windows x64 but I still have to create proper unit tests for the other platforms.
  2. Hopefully I have a job by this point but if not further tutorials will have to wait until after I get my next job. Any of you who have had to find developer work know that looking for a job is a job.
Wish me luck on the job hunt because it is rough out there. I have seen former coworkers have to do Door Dash to make ends meet despite having over 15 years of experience.
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.
Multiple Source Files
Split up your single source C++ applications.
If you find any bugs or typos in the tutorials please contact me.