Editor immediate mode GUI

While the engine is more or less ready for making games, it still needs a lot of features to be added, but without a visual editor that it is pretty tedious to achieve, so I have to work on the editor first, to make at least a skeleton framework on which editor plugins can be added (subeditors).

In the past I have worked with all the major GUI frameworks, from ancient BGI to Qt, MFC, WinForms, WPF, Gtk, wxWidgets, HTML5 and so on. The main problem is that some of them are huge and platform dependent, some cannot be themed, some are tedious to work with and the code can become cluttered pretty quickly. The only option remaining (and a pretty scary one), implement own custom GUI system.

Custom GUI would come in two flavors, retained and immediate mode. Retained mode is friendlier to an UX designer, because you can implement the declaration and definition of the UI in some JSON file and it is easy to modify by a non programmer, decoupling UI design from functionality. Immediate mode UI is a stateless option, where the UI is drawn every frame (or when data or widgets change), it is basically written in code (though you could JSON it and generate UI in code on the fly using the compiled JSON, in some bytecode, but it would be a bit weird, since it would not be a pure IMGUI).

Nevertheless, I have chosen immediate mode UI because:

  • it ties with the data, any change to data is naturally reflected in any widget that uses that data
  • it is quick to write, adding a button is simple as: if (button(“Compute”)) ……
  • it has automatic layouting, widgets flow, without the need to compute their coords by hand
  • it is programmer friendly 🙂

And so, I have implemented HorusUI, in development, an immediate mode gui library. It still needs a few more widgets and faster rendering, but it is promising. Here is a screenshot:


  • themable using JSON files and PNG images
  • automatic layouting
  • various text/font rendering functions
  • game-editor-specific friendly widgets
  • docking/undocking system, good for multi-monitor setups
  • crossplatform, it uses SFML at the moment
  • OpenGL rendering, with a Vulkan backend in the works

So for now, I will focus on making this ui toolkit as complete as possible to start work on the editor framework to get things moving. The editor helps with quick iteration on the features, plus hot reload of C++ modules (DLLs), should further aid with the development of the engine.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s