Compiling the library

To compile the library, make sure that imgui.h is set correctly in your include path so that it can be included like this:

#include <imgui.h>

Then, you can statically compile UTheme.cpp and UTheme.hpp into your project.

The library uses the yaml-cpp library to read YAML. If you don't use it already, you can easily use the git submodule under the yaml-cpp folder.

After all that setup is finished, include the UTheme.hpp header into one of your files and start using the library.

API

The UTheme.hpp header defines the Theme class. It has 3 member functions:

  1. load - Given a string that points to a file location, loads the file. Returns 0 on success and -1 when the file cannot be read
  2. save - Given a string that points to a file location, saves the current style to the specified file.
  3. showThemeEditor - Renders a window that you can use to modify the current style. Takes a bOpen argument for the close button on the window
  4. showThemeEditorInline - Renders the contents of the function above, without the window