Dear ImGui is integrated into cerlib as a first-class component.
This means that it has tight integration and is automatically available to you.
First, #include <imgui.h>
.
Then just use Game::setImGuiFunc()
to set the function that performs the Dear ImGui rendering.
ImGui 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 Dear ImGui website.