D2 log 072 – Rewriting (some bits)

While migrating the rendering & platform code to Sokol I saw a lot of my own old code. It was clumsy and convoluted. That made me happy: I could do it better now.

Decided to start a clean re-implementation of buttons and menus. I broke up the logic into smaller functions. One for the hover & click. Another for timing, to enable animating the states. And another one for keyboard navigation. The old code had all this mangled together. The new version is easier to maintain, extend and reuse.

Also changed the rendering of geometry primitives in the UI to use SDF instead of the old 9-patch technique. Much better!

I will continue with a few other bits, here and there, see how that goes.