Inside the companion
Build your studio
Two small CMake checkpoints: one executable, then a library with tests and presets.
Project files 9
Implement the checker pattern
The library implementation used to demonstrate compilation and linking.
#include "studio/checker.hpp"
namespace studio {
std::uint8_t shade(std::size_t x, std::size_t y) noexcept {
const bool bright = (((x / 2) ^ (y / 2)) & 1) != 0;
return bright ? std::uint8_t{224} : std::uint8_t{32};
}
}
This is the file included with the course. Copy and download give you its complete source.
Taking your work offline? Download all course companions
