M3: editor shell boots — ImGui overlay drawn over the live scene
Introduces engine.editor, a new plugin that renders an ImGui panel on top of whatever the scene is drawing, using Silk.NET.OpenGL.Extensions.ImGui's ImGuiController against the same GL context and window engine.render already owns. Getting the overlay to actually show up in the same frame (not delayed by one, which is what happens if UI draws after SwapBuffers) required splitting engine.render's Draw system: SwapBuffers moves out into its own Present system on a new Stage.Present, run by Engine.Host after every Stage.Render system — this plugin's Draw and, now, engine.editor's ImGui pass — has drawn into the same back buffer. Stage.Present is the second addition to the frame stage set (after FixedUpdate was scoped out for M4); docs/kernel-contract.md already committed to the set being fixed and kernel-defined, not plugin-extensible, and to only adding a stage when there's something real to run in it — SwapBuffers already needed somewhere to live once a second Render-stage system existed to race it. Also extends IEngineInput with a Native IInputContext property, the same escape hatch IEngineWindow.Native already is — ImGuiController's constructor needs the raw Silk.NET input context directly. Verified with a real windowed run: --screenshot after 5 frames shows the "Lingua" ImGui panel (FPS/frame counters) correctly composited over the still-correct 3D checkerboard quad from the M3 camera pipeline, in the same frame. Full suite still green: 65 tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1qPfzq8TDCUMFMV3UwV5N
This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
namespace Engine.Kernel.Scheduling;
|
||||
|
||||
/// <summary>
|
||||
/// Open question (see the footer of docs/kernel-contract.md): whether the
|
||||
/// set of stages is fixed or plugin-extensible. This is only enough to
|
||||
/// make the §3 example compile — not a decision.
|
||||
/// Fixed, kernel-defined, not plugin-extensible — see "Frame stages" in
|
||||
/// docs/kernel-contract.md §8. <see cref="Present"/> is the second addition
|
||||
/// to the original {Update, Render} set (after FixedUpdate was scoped for
|
||||
/// M4), added for M3's editor: engine.render splits its old single
|
||||
/// Clear+Draw+SwapBuffers system into a Render-stage draw and a
|
||||
/// Present-stage swap specifically so engine.editor's ImGui overlay — which
|
||||
/// has to run after the scene is drawn but before the buffers swap — has
|
||||
/// somewhere to register that isn't a race against load order. Not a stage
|
||||
/// added speculatively: SwapBuffers already needed to move somewhere real.
|
||||
/// </summary>
|
||||
public enum Stage
|
||||
{
|
||||
Update,
|
||||
Render,
|
||||
Present,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user