ImGui Debug Menu
Categories:
GS_Play adds a GS_Play entry to the in-game ImGui menu bar that any gem can contribute to. Each gem owns its own sub-menu, its own contents, and its own imgui dependency.
The core invariant: the anchor is content-free. GS_Core provides a component that broadcasts while the menu bar is being drawn, and gems draw their own entries in response. GS_Core never knows what other gems put there.
That makes the debug surface decentralised — a gem’s debug UI ships and versions with that gem — and it is a small, clear example of how the framework prefers extension to work.
For usage guides and setup examples, see The Basics: GS_Core.
Contents
Shipped Menus
| Menu | Gem | Contents |
|---|---|---|
| Core | GS_Core | A live Options editor, and a Game Manager window. |
| PhantomCam | GS_PhantomCam | Camera Management — live camera selection, priority override and lens editing. |
| Audio | GS_Audio | Audio Mixer — a master slider plus one per volume channel. |
Core ▸ Options
The Options window reads the entire option catalog, groups it by category, and renders the right widget for each option — checkbox, slider, dropdown or colour picker. It offers Apply All, Save, Reset All and per-option reset, with tooltips showing each option’s key, description and apply-target type. A preset dropdown lists Custom plus every loaded preset, keeping a snapshot of hand-tuned values so you can try a preset and return to your own.
Every edit goes through OptionsManagerRequestBus, so it exercises apply, persist and notify exactly as your own menus will. This is the fastest way to verify a new option end to end — author it, run, and drive it live before building any UI.
Audio ▸ Audio Mixer
Enumerates the configured volume channels and gives each a slider, plus master. Useful for balancing a mix without rebuilding.
How It Works
GS_ImGuiMenuComponent in GS_Core draws the top-level entry and broadcasts on a notification bus while the menu bar is open. Handlers draw their own sub-menu in response.
The bus is ordered. Each handler returns a sort key, so menu order is deterministic rather than dependent on which gem happened to register first. Core returns the lowest key and is always first; the default places everything else after it.
A handler that only wants a menu entry implements the menu notification alone. A handler that also wants windows additionally implements the imgui update listener — one component can own both its menu entry and the windows it opens. Core and PhantomCam both do this.
Adding a Menu to Your Gem
Create a component in your gem that handles the menu notification, returns a sort key, and draws its own sub-menu. Add the imgui update listener too if it opens windows.
Three things bite in practice, and all three are worth checking before concluding your menu is broken:
Register the component in both modules
Your handler must be registered in the client module and the editor module. The editor module overrides its required system components, so a component added only to the base module interface is silently absent in the Editor — the menu simply never appears, with no error.CMake. ImGui dependencies go PUBLIC on your gem’s private object target so the enable define propagates to the editor target through its public dependency, which keeps it ODR-safe. The editor target then needs no imgui configuration of its own. Add the imgui gem as a runtime dependency of the client module.
Guard each window separately. If your update handler returns early when one window is closed, every window below that point in the same function silently stops drawing. Check each window’s open flag around its own draw rather than returning.
See Also
For related systems:
- Settings — what the Core Options window edits
- Options Manager — the bus every edit writes through
- Mixing & Effects — what the Audio Mixer window drives
For conceptual overviews and usage guides:
Get GS_Core
GS_Core — Explore this gem on the product page and add it to your project.