SceneManager Class

Manages scene lifetime: loading, transitions, loading screens, and frame-boundary deferral.

internal sealed class SceneManager : Brine2D.Engine.ISceneManager, System.IAsyncDisposable

Inheritance System.Object → SceneManager

Implements ISceneManager, System.IAsyncDisposable

Fields
DefaultSystems
Methods
BeginFrame() Called by GameLoop at the start of each frame. Enables transition deferral for the duration of Update/Render and for any background scene load already in flight — see Brine2D.Engine.SceneManager._isDeferringTransitions.
LoadInitialSceneAsync<TScene>(Func<IServiceProvider,TScene>, CancellationToken) Blocking initial scene load used exclusively by GameApplication before the game loop starts. Not part of the public ISceneManager contract.
ProcessDeferredTransitions(CancellationToken) Resets deferral and fires any queued scene transition. Called by GameLoop after Update and Render. The active load task is exposed via Brine2D.Engine.SceneManager.ActiveLoadTask so GameLoop can track it for faulted-load detection independently of this method's invocation.
RaiseSceneLoadFailedIfPending() Fires Brine2D.Engine.SceneManager.SceneLoadFailed if a failure was recorded by the last load attempt. Called by GameLoop immediately after BeginFrame() so that any handler calling LoadScene<TScene>() will defer correctly and be tracked as the next pending transition. If no handler queues a recovery transition, the registered fallback scene is loaded automatically.