Hybrid GUI Beta
May 21, 2008
As some of you may have read, I’ve released a beta version of my new GUI toolkit, Hybrid.
The projects section of my website has been listing Hybrid for quite some time, yet that version was merely a prototype. The current one is actually a third installment of my OpenGL-powered GUIs. Be it a photon mapping program or some interactive walk-through, I’ve always wanted to have an in-game / in-engine GUI to play with. Using external controls, such as a separate MinWin pane next to my OpenGL context just didn’t feel right. So I rolled my own.
The first one was a rather classic retained-mode GUI that could make pictures such as:

It also had a more grayish look. Nevertheless, what pissed me off the most about its programming model, was that I had to create tons of wrappers, ‘GUI action handlers’ and separate the program into GUI init, action binding and event handling. In some cases it would’ve been much nicer to just inline e.g. the button actions in normal code, somehow.
Then I watched the excellent video about Immediate Mode GUIs from Casey Muratori, read some of the posts on Molly Rocket’s forums and decided that I wanted an IMGUI too. But I didn’t like all of the features of a classic IMGUI, such as the manual ID management, stuffing all logic of widgets only in functions and delegating a lot of power to the widget, instead of something that looks upon it. Of course, there were alternatives, some were even proposed in the follow-up posts.
So the idea was to create a GUI that lives somewhere between immediate and retained modes. The API must be immediate mode, but widgets should be able to store any state behind the scenes without the user programmer explicitly saving it somewhere. I wanted to be able to define widgets as simple classes, by overriding a few methods and leaving the rest to a common base. This is how the prorotype of Hybrid was conceived. It turned out ot be a bit messy because of some rather weird design choices at the very beginning, but it worked really well for Deadlock and some toy apps, such as a draft of a shader editor:



It was pretty pleasant to work with, in general. Yet, some ID management quirks were still there, and well - it was just a prototype.
Some time after finishing Deadlock, I took a univ course in ‘Software Analysis and Engineering’. After complaining to the lecturer, that the Waterfall model is not the best thing around, I was asked to make a non-standard project for the course. Most other folks on my year got project assignments and worked in teams. My objective was to create … documentation for Hybrid.
But well, who creates user-docs for a prototype? So I took the opportunity and rewrote Hybrid from scratch. This time I needed it to support some retained mode constructs in addition to the immediate mode API.
This is the result. And it makes nice pictures too:
So what’s the future of Hybrid? As written in the TODO, I’ve got some things to implement still. Probably easy style and css-ish widget-class management is going to be the most important. Animation of arbitrary properties will also be a must-have if it’s to become a useful game GUI toolkit. On top of that, I’ve got some widget orders that I need to deliver, such as a color picker… I’m considering (s)RGB + XYZ + HSV + Spectrum - based picking :P
There also remain a few usability and stability issues, but that’s the reason it’s a Beta and not a final release.
Filed under: Uncategorized | Comments (8)
