ocornut.imgui
importDear ImGui 1.92.8 core and GLFW/OpenGL3 backend modules for mcpp (import imgui.core;)
import imgui.core;
模块名读自上游 src/core.cppm 里的 `export module` 声明。
mcpp add ocornut.imgui@1.92.8
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// Public imgui module package end-to-end assertion: import-only consumption
// (imgui.core + glfw_opengl3 backend), context + font atlas + one frame,
// software-only (no window). Linux-only (see mcpp.toml).
#ifdef __linux__
import std;
import imgui.core;
import imgui.backend.glfw_opengl3;
int main() {
auto init = &ImGui::Backend::GlfwOpenGL3::Init;
auto shutdown = &ImGui::Backend::GlfwOpenGL3::Shutdown;
if (init == nullptr || shutdown == nullptr) {
return 1;
}
ImGuiContext* context = ImGui::CreateContext();
if (context == nullptr) {
return 2;
}
ImGui::SetCurrentContext(context);
ImGuiIO& io = ImGui::GetIO();
// …
tests/examples/imgui-module/tests/imgui_module.cpp · 项目 tests/examples/imgui-module
构建 · 上游清单
- modules
imgui.core- targets
imgui (lib)- manifest version
1.92.8- dependencies
compat- 来源
https://raw.githubusercontent.com/mcpplibs/imgui-m/1.92.8/mcpp.toml