ImGui

ImGui is integrated into cerlib as a first-class component.

This means that it has tight integration and is automatically available to you.

ImGui is controlled via the CERLIB_ENABLE_IMGUI option, which is ON by default, so you don’t have to configure anything to access ImGui.

First, #include <imgui.h>.

Then just use Game::setImGuiFunc() to set the function that performs the ImGui rendering.

Example
#include <imgui.h>

// ...

auto game = Game("My Game");

game.setImGuiFunc([&] {
    ImGui::Begin("My ImGui Window");
    ImGui::Text("Hello World!");

    if (ImGui::Button("Click here")) {
        logInfo("Button was clicked!");
    }

    ImGui::End();
});

while (game.tick()) {
    // ...
}

The function you pass to setImGuiFunc() is automatically called by cerlib at the right time, at the end of your game loop.

For detailed instructions and documentation, please visit the ImGui website.