For my current project, I needed to render the GUI on a bare platform.
So I had to draw primitives such as:
– rounded rectangles
These can be filled or not, and have a border.
They also need to be properly clipped, access the memory in a smart way and perform some basic blending (alpha/1 – alpha).
It didn’t take me too long (around one big afternoon in total, optimizations included), was kind of funny to parse the literature on the topic and discover it has not much evolved for years (what was expected for such a well-known subject) and make them the way I would nowadays instead!
The main points (no pun intended) were all about Bresenham (for lines but also for circles, exit the sine), array of horizontal lines (min/max x coordinates), and etc.
I really enjoyed doing it – and it reminded me some good old memories.