Skip to content

Overview

Brine2D

Brine2D.Engine Namespace

Classes
DefaultFallbackScene The built-in fallback scene displayed when a scene load fails and SceneLoadFailed has no handler that queues a recovery transition. Shows the failed scene name and exception message. Replace it project-wide with builder.UseFallbackScene<T>().
EngineInitializationException Thrown when the game engine fails to initialize (renderer, SDL3, etc.). Inherits from System.InvalidOperationException so existing catch sites remain valid.
FallbackSceneConfiguration Carries the fallback scene type registered via UseFallbackScene<T>(). Defaults to DefaultFallbackScene. Consumed by RaiseSceneLoadFailedIfPending().
GameContext Default implementation of game context.
GameEngine Default implementation of the game engine.
GameLoop Main game loop. Runs synchronously on the main thread as required by SDL3. Scene transitions are non-blocking; loading screens render while the next scene loads in the background.
LoadingScene Base class for loading screens. Framework properties (Logger, Renderer) are set automatically by SceneManager. Loading screens do not have a World; they render between scene scopes. Override OnEnter() and OnExit() for one-time setup and teardown (e.g., starting music). Both are called on the main thread.
Scene Base class for game scenes. Override OnLoadAsync, OnEnter, OnUpdate, OnRender, OnExit, and OnUnloadAsync to implement scene logic. Framework properties (Logger, World, Renderer, Input, Audio, Game) are set automatically before OnLoadAsync is called.
SceneBase Common base for all scene types. Holds framework-injected services and lifecycle hooks. Not inheritable outside the engine assembly.
SceneFrameworkServices Groups the framework services that SceneManager stamps onto every scene. Registered as a singleton and resolved by DI — all constructor parameters are already in the container.
SceneLoadFailedEventArgs Event arguments for SceneLoadFailed.
SceneManager Manages scene lifetime: loading, transitions, loading screens, and frame-boundary deferral.
SceneWorldConfiguration Carries the per-scene world configuration delegate registered via ConfigureScene(Action<IEntityWorld>), the set of default systems excluded via ExcludeDefaultSystem<T>(), and any additional default systems added via AddDefaultSystem<T>(). Applied by SceneManager after the built-in system inclusion check.
Interfaces
IGameContext Represents the context of the running game application. Similar to HttpContext in ASP.NET.
ILoadingProgress Provides progress reporting during scene loading.
ISceneLoadErrorInfo Provides read access to the most recent scene load failure. Inject this into a fallback scene to display error details. Populated by the framework before the fallback scene is loaded.
ISceneLoop Frame-level contract consumed exclusively by GameLoop. Drives the scene system through each frame's lifecycle: begin, fixed update, update, render, and deferred work.
ISceneManager Manages scene lifetime, transitions, and loading screens. Inject this to trigger scene navigation from within your game code.
ISceneTransition Represents a transition effect between scenes. Transitions run during scene loading to provide visual feedback.