compat.imgui
#includeDear ImGui immediate-mode GUI library core sources
#include <imgui.h>
mcpp add compat.imgui@1.92.8-docking
Usage
From this repository's own test project — built and run by CI, not written for the website.
// Build + link the full imgui GLFW/OpenGL3 backends (the recipe coverage). The
// window run requires a display, so it is opt-in (MCPP_RUN_WINDOW=1); headless
// CI compiles + links and returns 0. Off-Linux this is a no-op.
#ifdef __linux__
#include <cstdio>
#include <cstdlib>
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#include <imgui.h>
#include <imgui_impl_glfw.h>
#include <imgui_impl_opengl3.h>
#include "imgui_impl_glfw.cpp"
#include "imgui_impl_opengl3.cpp"
static int run_window() {
glfwSetErrorCallback([](int code, const char* message) {
std::fprintf(stderr, "GLFW error %d: %s\n", code, message ? message : "");
});
if (!glfwInit()) return 10;
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
// …
tests/examples/imgui-window/tests/imgui_glfw_backend.cpp · project tests/examples/imgui-window
Build
- targets
imgui (lib)- language
c++23- import std
- no
- include dirs
*, */backends
Sources (4)
*/imgui.cpp*/imgui_draw.cpp*/imgui_tables.cpp*/imgui_widgets.cpp