Please note that I don't update this web site anymore. You can visit my new personal blog at

Immediate Mode GUIs

Thursday, October 27, 2005

Ever since I read The Humane Interface by Jef Raskin, I've been a usability aficionado. I love designing a good, usable interface, so whenever I'm involved in the development of an application or web site, I always claim the job of GUI designer.

Unfortunately, this usually comes with the job of GUI programmer and, let's face it, GUI programming sucks. When I taught C++ programming a couple of years back, my mantra was programming is fun and I really believe that. But I make an expection when it comes to GUI programming. I have never had any funny programming GUIs.

Today, I ran across a video presentation about immediate mode GUIs. It looks very interesting and I definitely will be experimenting with it. Hopefully, it will make GUI programming more fun.

If you are involved with GUI programming of any kind, you should really watch this presentation, but I'll describe the basic premise. Currently, you create a GUI by initializing all the widgets and then you provide interaction code by handling callbacks. This means that the GUI is kind of static. It's a very different model from the way you handle graphics in game, where you don't initialize anything, but you decide what gets drawn at every iteration of the game loop.

Immediate mode GUIs work like game graphics. Instead of defining a button and handling its events, you call a function like DoButton() for every frame and it returns a boolean indicating whether the button got pressed or not. It's like modal dialog boxes in Windows, where you call ShowDialog() and the return value indicates which button was pressed.

Back to blog index


Tell me what you think

Since I'm not updating this site anymore, I disabled comments. You can visit me at my new site: