This is another post in the Lessons Learned series. Today’s lesson: immediate-mode GUIs
I’ve you have ever worked with Win32, GTK, or pretty much any GUI toolkit I know of, you’re probably used to treating the GUI as a bunch of controls. If you need a button on the screen then you create an instance of the Button class and add a pointer to that button to the Window object. Then behind the scenes Windows or GTK or whatever handles the rendering and processing of the button. All you have to do is wait for the user to click it.