https://www.al-techs.com/2020/03/gfx-gameloop.html