Repository navigation
[minor] Add ImGuiApp.EnableExtensions to turn on ImGui extensions after launch - #623
Merged
Merged
Conversation
…er launch An application that launches with ImGuiAppConfig.Extensions = None to keep ImNodes off the startup path can now enable it the first time a node editor opens. ImGuiExtensionManager.Enable adds to the enabled set (Initialize replaces it), probes, shares the ImGui context and creates the dark-styled context exactly as launch does, and is idempotent. Enabling ImGuizmo inside a frame begins its frame at once, since the per-frame BeginFrame has already passed and Manipulate would otherwise draw through a null draw list. Works under ImGuiAppHarness unchanged; covered by EnableExtensionsTests and new ImGuiExtensionManager tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6T8bWvnxhB7gckKnGSN5D
|
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Requested by Matt · project thread
Before:
ImGuiAppConfig.Extensionsfixed the set of ImGui extensions at launch. An app that launched withNoneto keep ImNodes' startup cost off the launch path had no supported way to turn ImNodes on later.ImGuiExtensionManager.Initializereplaces the enabled set, so calling it again would drop extensions that were already on.After:
ImGuiApp.EnableExtensions(ImGuiAppExtensions)turns extensions on after launch, on the render thread, either between frames or insideOnRenderbefore the extension is drawn with. It adds to the enabled set rather than replacing it, it is idempotent, and it returns which of the requested extensions are ready to draw with. Before launch it throwsInvalidOperationException, because the launch-time setting isImGuiAppConfig.Extensions. It works underImGuiAppHarnesswithout any harness changes.How: the new
ImGuiExtensionManager.Enableprobes each newly added extension and shares the ImGui context with only those (SetImGuiContextandBeginFrameare now built on per-extension helpers). It then callsCreateExtensionContexts, which creates the ImNodes and ImPlot contexts with the dark style and leaves existing contexts alone. ImGuizmo draws into the window that itsBeginFrameopens, and inside a frame the per-frameBeginFramehas already run. So when ImGuizmo is enabled while the ImGui context isWithinFrameScope,Enablecalls itsBeginFramestraight away. I checked that this is needed: without it,Manipulatein the same frame segfaults. Tests:EnableExtensionsTests(harness) covers enabling ImNodes between frames and insideOnRender, enabling twice, keeping an already enabled ImPlot, ImGuizmoManipulatein the frame it is enabled, and the throw before launch. There are also new unit tests forImGuiExtensionManager.Enable. CLAUDE.md and the ImGui.App and ImGui.App.Testing READMEs are updated.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q6T8bWvnxhB7gckKnGSN5D
Generated by Claude Code