refactor(render): compose render frame orchestrator
Move the accepted draw transaction and failure recovery behind typed frame-phase owners so GameWindow only supplies immutable frame input. Preserve retail draw order, make ImGui/bootstrap shutdown ownership explicit, and restore exact text-render GL state on failures.\n\nCo-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
28e1cf8029
commit
9d7df1bfc5
25 changed files with 1675 additions and 279 deletions
|
|
@ -0,0 +1,35 @@
|
|||
namespace AcDream.App.Rendering;
|
||||
|
||||
internal interface IRenderWeatherFramePhase
|
||||
{
|
||||
void Tick(double deltaSeconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Preserves the accepted pre-world order after the GPU/resource transaction:
|
||||
/// begin optional developer UI, advance render-time weather, then hand the
|
||||
/// completed preparation to the world phase.
|
||||
/// </summary>
|
||||
internal sealed class RenderFramePreparationController : IRenderFrameResourcePhase
|
||||
{
|
||||
private readonly IRenderFrameResourcePhase _resources;
|
||||
private readonly IDevToolsFrameLifecycle? _devTools;
|
||||
private readonly IRenderWeatherFramePhase _weather;
|
||||
|
||||
public RenderFramePreparationController(
|
||||
IRenderFrameResourcePhase resources,
|
||||
IDevToolsFrameLifecycle? devTools,
|
||||
IRenderWeatherFramePhase weather)
|
||||
{
|
||||
_resources = resources ?? throw new ArgumentNullException(nameof(resources));
|
||||
_devTools = devTools;
|
||||
_weather = weather ?? throw new ArgumentNullException(nameof(weather));
|
||||
}
|
||||
|
||||
public void Prepare(RenderFrameInput input)
|
||||
{
|
||||
_resources.Prepare(input);
|
||||
_devTools?.BeginFrame((float)input.DeltaSeconds);
|
||||
_weather.Tick(input.DeltaSeconds);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue