|
| 1 | +# imgui-m: GL Runtime Boundary Plan |
| 2 | + |
| 3 | +> 状态: active |
| 4 | +> 分支: `codex/gl-runtime-closure-imgui` |
| 5 | +> PR: pending |
| 6 | +> Last updated: 2026-06-03 |
| 7 | +> 目标: 保持 ImGui module wrapper 简洁,提供可诊断的最小窗口示例,并明确 GL runtime 由 mcpp/mcpp-index 层闭合。 |
| 8 | +
|
| 9 | +## Scope |
| 10 | + |
| 11 | +This repository owns the ImGui module wrapper and examples. It should prove |
| 12 | +that consumers can write a minimal window application with module imports, but |
| 13 | +it should not package platform OpenGL/GLX/EGL drivers. |
| 14 | + |
| 15 | +## Current Work |
| 16 | + |
| 17 | +- `examples/minimal_window/` demonstrates a module-only consumer path. |
| 18 | +- GLFW error forwarding lets examples report the actual window creation |
| 19 | + failure instead of silently exiting. |
| 20 | +- README and architecture docs explain that `compat.opengl` provides headers |
| 21 | + and registry data, not platform GL runtime libraries. |
| 22 | + |
| 23 | +## Implementation Plan |
| 24 | + |
| 25 | +- [x] Create this repository-level plan checkpoint. |
| 26 | +- [x] Add a minimal module-only window example. |
| 27 | +- [x] Add GLFW error accessors for backend diagnostics. |
| 28 | +- [x] Add test coverage for exported diagnostic API presence. |
| 29 | +- [x] Adjust the minimal example to capture GLFW error details before cleanup |
| 30 | + when a cleanup call could clear the last error. |
| 31 | +- [x] Keep README and architecture docs aligned with the final mcpp-index |
| 32 | + package names. |
| 33 | + - If the runtime provider lands as `compat.glvnd`, use that name. |
| 34 | + - If the package name changes during implementation, update docs only after |
| 35 | + the index PR settles. |
| 36 | +- [x] Add or update CI build-checks for `examples/minimal_window`. |
| 37 | + - Runtime execution should stay conditional on a visible display and OpenGL |
| 38 | + runtime. |
| 39 | + |
| 40 | +## Non-Goals |
| 41 | + |
| 42 | +- Do not bundle `libGL`, GLX/EGL, Mesa, NVIDIA, or host GPU driver files here. |
| 43 | +- Do not hard-code host library paths in example source. |
| 44 | +- Do not make headless CI depend on a real display. |
| 45 | +- Do not change `compat.opengl` semantics from this repository. |
| 46 | + |
| 47 | +## Verification |
| 48 | + |
| 49 | +- [x] `mcpp build` |
| 50 | +- [x] `mcpp test` |
| 51 | +- [x] `cd examples/basic && mcpp run` |
| 52 | +- [x] `cd examples/minimal_window && mcpp build` |
| 53 | +- [x] `cd examples/glfw_opengl3 && mcpp build` |
| 54 | +- [ ] On a machine with working display/runtime closure: |
| 55 | + `cd examples/minimal_window && mcpp run` |
| 56 | + |
| 57 | +## PR / CI / Merge Notes |
| 58 | + |
| 59 | +- [x] Commit this plan as the first checkpoint on the feature branch. |
| 60 | +- [ ] Keep current implementation checkpoint commits small. |
| 61 | +- [ ] Open a PR with sanitized paths and no local machine details. |
| 62 | +- [ ] Include a test plan that separates build-only CI from display-required |
| 63 | + runtime checks. |
| 64 | +- [ ] Wait for CI. |
| 65 | +- [ ] Squash merge after required checks pass. |
| 66 | + |
| 67 | +## Cross-Repository Dependencies |
| 68 | + |
| 69 | +- `mcpp` must implement runtime metadata/run environment support before the |
| 70 | + minimal window example can be expected to run without manual environment |
| 71 | + setup. |
| 72 | +- `mcpp-index` must express GLFW/OpenGL runtime requirements through package |
| 73 | + metadata. |
| 74 | +- `xim-pkgindex` is not required for this repository PR unless a released mcpp |
| 75 | + version becomes a package-index dependency. |
0 commit comments