pplux / imgui-app

Dear IMGUI + Render + Window handling, amalgamation in two files ready to use
MIT License
161 stars 17 forks source link
amalgamation imgui single-header-library

imgui-app

Imgui-app is an amalgamation of two amazing projects Dear Imgui and Sokol libraries into two files to make it very easy to start working with imgui. It might be useful when you need to do some UI quickly for a project but do not want to care that much how to get imgui up and running (imgui compilation, backend rendering, window handling, ...).

test.png

Howto

To start using imgui-app you need to add these two files to your project:

Once you are ready to display the UI, just call imgui_app, see the example.

#include "imgui.h"

void frame() {
    ImGui::Text("Hello, world %d", 123);
    ImGui::ShowDemoWindow();
}

int main(int, char **) {
    // when ready, call the UI:
    imgui_app(frame, "IMGUI_APP", 800, 600);
    // execution continues when window is closed
    return 0;
}

Finally, make sure to select the proper sokol render backend, by compiling your project with -DSOKOL_GLCORE33 or any of the available backends.

Optional files:

This files are not required to use imgui-app, but if you need access to more advanced components from imgui or sokol here they are:

Notes: