float flash = abs(sin(_frameNumber / 120.f));
This line is causing a problem when running the code from the "Mainloop Code" chapter. The abs function outside the std-namespace casts the parameter to an int, which leads to flash always being zero, making the screen always appear black. I suggest replacing it with std::abs or `fabs. This StackOverflow answer explains why that makes a difference: https://stackoverflow.com/a/3118188.
float flash = abs(sin(_frameNumber / 120.f));
This line is causing a problem when running the code from the "Mainloop Code" chapter. Theabs
function outside thestd
-namespace casts the parameter to an int, which leads toflash
always being zero, making the screen always appear black. I suggest replacing it withstd::abs
or `fabs. This StackOverflow answer explains why that makes a difference: https://stackoverflow.com/a/3118188.