Add runtime scene ready callback

This commit is contained in:
Meta Vens 2026-05-25 07:06:11 +01:00
commit 41934c93d2
2 changed files with 11 additions and 0 deletions

View file

@ -27,6 +27,10 @@ public interface IAquariumRuntime : IDisposable
AquariumFrame ComposeFrame(AquariumFrame frame, AquariumFrameInput input);
void OnSceneReady()
{
}
void FlushState();
}

View file

@ -41,6 +41,7 @@ public static class AquariumHost
var requiredReadyFrames = ParseHeadlessReadyFrames();
var captureFramePath = ParseCaptureFramePath(args);
var capturedFrame = false;
IAquariumRuntime? sceneReadyRuntime = null;
while (true)
{
@ -88,6 +89,12 @@ public static class AquariumHost
if (renderer.HasPresentedReadyFrame)
{
readyFrames++;
var activeRuntime = runtimeLoader.Runtime;
if (!ReferenceEquals(sceneReadyRuntime, activeRuntime))
{
activeRuntime.OnSceneReady();
sceneReadyRuntime = activeRuntime;
}
}
if (runtime.Options.Headless