Add runtime scene ready callback
This commit is contained in:
parent
00ca3e5c2f
commit
41934c93d2
2 changed files with 11 additions and 0 deletions
|
|
@ -27,6 +27,10 @@ public interface IAquariumRuntime : IDisposable
|
|||
|
||||
AquariumFrame ComposeFrame(AquariumFrame frame, AquariumFrameInput input);
|
||||
|
||||
void OnSceneReady()
|
||||
{
|
||||
}
|
||||
|
||||
void FlushState();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue