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