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: Nov 2nd, 2024

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 has its first official stable release.

Since SDL3 is not officially released yet, there are changes being made to the final API and that might cause tutorial code to break. Here are the current sha values of the git commits I am using:
  • SDL3 - b641c2a0db26127f3e379f8b92bc15feb500e242
  • SDL3_image - a010117fee88255a32492ae9a43e93a213d608ec
  • SDL3_ttf - 45faf5a38bd8f9319ac0fe66cfcc4ceb192f9fa4
  • SDL3_mixer - f3318efa16ecc2f5a3beec8a004b9cbc4cd38d40

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.
If you find any bugs or typos in the tutorials please contact me.