Lazy Foo' Productions

SDL Forums external link SDL 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: Jan 1st, 2026

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

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. As of time of writing, SDL3_mixer is the the last library we're waiting for. 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.

Until this tutorials set is officially released, status updates will be posted the the official Ko-Fi page.

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 (we'll see in a few months), 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. Once SDL3_mixer is released I will put a coat a polish on the tutorials and post set up tutorials 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 will wait until SDL3_mixer is officially released before testing on other platforms because I do not want to have to deal with cmake.
  2. Once all the tutorials are tested on supported platforms (and any potential fragmentation issues are taken care of), I will create the Windows/Linux/MacOS set up tutorials.
  3. Once all the set up tutorials are complete, the tutorials will be published. 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.