lainchan / r

writing a GUI toolkit

Hououin Kyouma · 2026-08-03 14:53
does anyone know of books or articles or really anything about how to write a GUI library? I have been writing a library that implements drawing primitives like lines, squares, polygons, beziers, and even truetype text (ad hoc parser and rasterizer, no freetype dependency) but now I'm at the stage where I have to go up one layer and start using those primitives to write widgets, and then find a way to organize those widgets within the window, and that's a little more daunting. it feels like a more open-ended problem I hate that I have to specify this, but I don't use ai, I need resources that are human readable
Mario Rossi · 2026-08-03 20:46
Just find open-source projects and see how they structure/architect stuff. You didn't mention the language, but ImGui is pretty popular in C++ game development space, you could learn a lot from it. https://github.com/ocornut/imgui