This kind of codes will require lots of computing, and costs long time, which proves, from sides, that GPU is more powerful than CPU, in parallel floating computing.
I think learning graphics programming with this kind of begining has the following advantages:
- easy to install and compile: all you need is a C compiler
- be able to dive into the math magic behind computer graphics
- be able to understand what will happen behind each frame of game or something
- be able to understand the limit of CPU
- be able to understand graphics APIs, after transfer from these raw functions to generic GUI APIs
Be hard-core, stop from choosing frameworks.
codes: https://gist.github.com/Liam0205/78132b55266e6a80648333984370c842#file-refraction_m-c