diff --git a/.xlings.json b/.xlings.json index f4a5155..1388672 100644 --- a/.xlings.json +++ b/.xlings.json @@ -1,5 +1,5 @@ { "workspace": { - "xim:mcpp": "0.0.48" + "xim:mcpp": "2026.8.5.4" } } diff --git a/README.md b/README.md index eef36cc..9f2f57d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ - **纯模块导入** — `import imgui.core;`,消费者代码零 `#include` - **三档使用体验** — `imgui.app` 一行出窗口(默认档)/ `imgui.backend` 编译期契约(自动档)/ `imgui.backend.` 显式选后端(专家档),换后端 = 改一行 import + alias -- **特性可插拔** — `features = ["docking-full"]` 解锁面板停靠 + 拖出主窗口变独立 OS 窗口 +- **特性可插拔** — `features = ["docking-full"]` 解锁面板停靠 + 拖出主窗口变独立 OS 窗口;`app` 档 + 开启 `imgui.app` facade(它是本仓库的发明,不属于上游 Dear ImGui,所以默认不给) - **不绑定工具链、不打包 GL 驱动** — Linux / macOS / Windows 三平台 CI;GL 运行时由 mcpp 生态自动闭合 ## 快速开始 @@ -30,8 +31,8 @@ mcpp new myapp --template imgui && cd myapp && mcpp run # 窗口直接出现 或在已有项目中手动接入: ```toml -[dependencies] -imgui = "0.0.6" +[dependencies.ocornut] +imgui = { version = "1.92.8", features = ["app"] } ``` ```cpp @@ -68,8 +69,8 @@ int main() { | `docking-full` | 组合糖 = `["docking", "viewports"]`,完整 docking 体验 | ```toml -[dependencies] -imgui = { version = "0.0.6", features = ["docking-full"] } +[dependencies.ocornut] +imgui = { version = "1.92.8", features = ["docking-full", "app"] } ``` docking/viewports 源码来自上游 docking tag(`compat.imgui 1.92.8-docking`,主线超集——特性关闭时行为与主线一致)。需 mcpp ≥ 0.0.47。 diff --git a/examples/app_minimal/mcpp.toml b/examples/app_minimal/mcpp.toml index 137de97..9032474 100644 --- a/examples/app_minimal/mcpp.toml +++ b/examples/app_minimal/mcpp.toml @@ -5,4 +5,4 @@ description = "Tier-0 imgui.app facade consumer" license = "MIT" [dependencies] -imgui = { path = "../.." } +imgui = { path = "../..", features = ["app"] } diff --git a/examples/docking/mcpp.toml b/examples/docking/mcpp.toml index 883bba2..4f94183 100644 --- a/examples/docking/mcpp.toml +++ b/examples/docking/mcpp.toml @@ -5,4 +5,4 @@ description = "Dockable-windows demo using the imgui `docking` feature" license = "MIT" [dependencies] -imgui = { path = "../..", features = ["docking-full"] } +imgui = { path = "../..", features = ["docking-full", "app"] } diff --git a/mcpp.toml b/mcpp.toml index fef0ef6..b825fd1 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -1,7 +1,14 @@ +# The namespace names whose library this is, not who packaged it. Dear ImGui is +# ocornut's; this repository only adds the C++23 module layer over it. The +# version is upstream's, for the same reason: `0.0.6` told a consumer nothing +# about which ImGui they were getting. +# +# See mcpp-index#163 for the ecosystem-wide rule and the migration table. [package] +namespace = "ocornut" name = "imgui" -version = "0.0.6" -description = "Dear ImGui core and GLFW/OpenGL3 backend modules for mcpp" +version = "1.92.8" +description = "Dear ImGui 1.92.8 core and GLFW/OpenGL3 backend modules for mcpp" license = "MIT" authors = ["imgui module contributors"] repo = "https://github.com/mcpplibs/imgui-m" @@ -9,10 +16,12 @@ repo = "https://github.com/mcpplibs/imgui-m" [lib] path = "src/core.cppm" +# `src/app.cppm` is NOT here — it is behind the `app` feature below. Everything +# that remains corresponds to something upstream Dear ImGui actually ships: +# the core API, and the GLFW/OpenGL3 backends from upstream's own backends/. [build] sources = [ "src/core.cppm", - "src/app.cppm", "src/backends/backend.cppm", "src/backends/platform_glfw.cppm", "src/backends/renderer_opengl3.cppm", @@ -24,6 +33,12 @@ sources = [ [features] default = [] +# app: the `imgui.app` facade — a run-loop that owns window and context +# lifecycle so a consumer supplies only a per-frame callback. It is THIS +# repository's invention, not part of Dear ImGui, which is exactly why it is +# opt-in: a consumer who wants the native ImGui API should not be handed a +# framework along with it. +app = { sources = ["src/app.cppm"] } # docking: export the Dock* API surface and auto-enable # ImGuiConfigFlags_DockingEnable in the imgui.app facade. docking = [] diff --git a/templates/docking/mcpp.toml.in b/templates/docking/mcpp.toml.in index 879293e..906ef6e 100644 --- a/templates/docking/mcpp.toml.in +++ b/templates/docking/mcpp.toml.in @@ -2,5 +2,8 @@ name = "{{project.name}}" version = "0.1.0" -[dependencies] -{{self.name}} = { version = "{{self.version}}", features = ["docking-full"] } +# `ocornut` is spelled out: templates substitute only project.name, +# self.name and self.version — there is no namespace placeholder yet. +# See mcpp-index#163. +[dependencies.ocornut] +{{self.name}} = { version = "{{self.version}}", features = ["docking-full", "app"] } diff --git a/templates/window/mcpp.toml.in b/templates/window/mcpp.toml.in index ba6c3dd..b33e661 100644 --- a/templates/window/mcpp.toml.in +++ b/templates/window/mcpp.toml.in @@ -2,5 +2,8 @@ name = "{{project.name}}" version = "0.1.0" -[dependencies] -{{self.name}} = "{{self.version}}" +# `ocornut` is spelled out: templates substitute only project.name, +# self.name and self.version — there is no namespace placeholder yet. +# See mcpp-index#163. +[dependencies.ocornut] +{{self.name}} = { version = "{{self.version}}", features = ["app"] }