SDL2 tutorials updated with cmake

Sat, 13th August 2022

All the tutorials have now been updated to use cmake, to help make compiling them on different platforms a bit easier.

So, when compiling the code, one would now use:

cmake CMakeLists.txt, followed by make

or

mkdir build
cd build
cmake ..
make

The latter will result in a tidier build, with all the cmake-related gubbins being stored in the build directory. The binary itself will be created alongside the CMakeLists.txt file, and also relative to the assets.

IDEs such as VSCode also have support for cmake, and should produce the binaries in the expected manner.

The code itself has also been reformatted and styled, although this won't have any impact on the tutorial pages themselves; the logic in the functions remains identical. The new archives have been uploaded to both itch.io and our own site.

Related News

SDL2 Versus game tutorial
Wed, 20th March 2024

Download keys for SDL2 tutorials on itch.io
Sat, 16th March 2024

SDL2 Santa game tutorial 🎅
Thu, 23rd November 2023

SDL2 Shooter 3 tutorial
Wed, 15th February 2023

SDL2 map editor tutorial [UPDATED]
Sat, 10th September 2022

Desktop site