Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .xlings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"workspace": {
"xim:mcpp": "0.0.48"
"xim:mcpp": "2026.8.5.4"
}
}
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

- **纯模块导入** — `import imgui.core;`,消费者代码零 `#include`
- **三档使用体验** — `imgui.app` 一行出窗口(默认档)/ `imgui.backend` 编译期契约(自动档)/ `imgui.backend.<impl>` 显式选后端(专家档),换后端 = 改一行 import + alias
- **特性可插拔** — `features = ["docking-full"]` 解锁面板停靠 + 拖出主窗口变独立 OS 窗口
- **特性可插拔** — `features = ["docking-full"]` 解锁面板停靠 + 拖出主窗口变独立 OS 窗口;`app` 档
开启 `imgui.app` facade(它是本仓库的发明,不属于上游 Dear ImGui,所以默认不给)
- **不绑定工具链、不打包 GL 驱动** — Linux / macOS / Windows 三平台 CI;GL 运行时由 mcpp 生态自动闭合

## 快速开始
Expand All @@ -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
Expand Down Expand Up @@ -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。
Expand Down
2 changes: 1 addition & 1 deletion examples/app_minimal/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ description = "Tier-0 imgui.app facade consumer"
license = "MIT"

[dependencies]
imgui = { path = "../.." }
imgui = { path = "../..", features = ["app"] }
2 changes: 1 addition & 1 deletion examples/docking/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
21 changes: 18 additions & 3 deletions mcpp.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
# 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"

[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",
Expand All @@ -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 = []
Expand Down
7 changes: 5 additions & 2 deletions templates/docking/mcpp.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
7 changes: 5 additions & 2 deletions templates/window/mcpp.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Loading