I’ve written a “simple” (1) panel-based UI system for OpenGL that operates somewhat like Swing except its painted 60 fps.
It has mouse (move, drag, press, release, enter, exit, click, etc.) and key events (press, release) that are dispatched to the panels which in turn dispatches events to any child components.
I’ve really come to appreciate the amount of effort required to write any UI library. I’ve probably spent close to 30 working days in total on it and each time I revisit it to add functionality I find new bugs and new ways to do things.
Recently I’ve added some more complicated UI controls such as auto-paginating text areas, single-selection lists, and drop-down selection lists.
Overall the code is clean and manageable but wowsers, it took considerable effort.
(1) “Simple” in functionality but not simple in code.