4 ms·
I once wrote a tiny cpu rasterizer in dlang. It is more efficient than what is shown here, since it uses only integer arithmetic (based on bresenham's algorithm
by the5avage 2y ago
I once wrote a tiny cpu rasterizer in dlang. It is more efficient than what is shown here, since it uses only integer arithmetic (based on bresenham's algorithm). E.g. for a triangle it outputs the points in the triangle without ever considering a single pixel outside the triangle.
It's based on ranges (similiar to the ones added to C++) and the concept works very well imo. Could be a good exercise to translate it to C++23 (using coroutines with the range "generator").
https://github.com/the5avage/shapes https://github.com/the5avage/shapes