SDL School

Why SDL3

SDL School teaches SDL3 by default. Every lesson also has an SDL2 version. You choose the version with the selector at the top of the lesson.

Why we start with SDL3

SDL3 is the current version of SDL. The SDL project released it in January 2025. SDL2 entered maintenance mode (bug fixes, no new features) in 2023. The SDL wiki says that the project will eventually retire SDL2. The wiki also tells developers to move their programs to SDL3.

SDL3 lets one program run on the desktop and in the browser. A browser does not let a program stay in a loop inside main(). SDL3 has main callbacks, which are functions that SDL calls for you: SDL_AppInit, SDL_AppIterate, SDL_AppEvent, and SDL_AppQuit. With main callbacks, the lesson code needs no #ifdef lines.

SDL3 is also easier to read in three places:

When to choose SDL2

If your course, your book, or your existing project uses SDL2, choose SDL2. Much of the older SDL material on the web also uses SDL2.

The SDL2 lessons teach the same ideas. SDL2 has no main callbacks, so each SDL2 lesson has a short #ifdef __EMSCRIPTEN__ block to run in the browser.

How to move from SDL2 to SDL3

Read the SDL3 migration guide. The guide also lists scripts that do many of the renames for you, for example rename_symbols.py.