Skip to content

Events

Brine2D

Brine2D.Events Namespace

Classes
ApplicationQuitRequestedEvent Raised when the application quit is requested (e.g., window close button).
EventBus Singleton event bus for publish/subscribe messaging between systems and components. Thread-safe: Subscribe, Unsubscribe, and ClearAll may be called from any thread. Publish is allocation-free on the hot path; it reads a pre-committed handler array without holding the lock during invocation.
EventBus.Subscription Returned by Subscribe<T>(Action<T>) — disposes the subscription idempotently.
HeadlessEventPump No-op event pump for headless mode (servers, testing).
SDL3KeyDownEvent Internal SDL3 events - not exposed to user code. Used for communication between SDL3EventPump and SDL3InputService.
WindowFocusGainedEvent Raised when the window gains focus.
WindowFocusLostEvent Raised when the window loses focus.
WindowHiddenEvent Raised when the window is hidden from the user (e.g., system sleep, lock screen, or display off). Rendering is suspended until WindowShownEvent is received.
WindowMinimizedEvent Raised when the window is minimized.
WindowResizedEvent Raised when the window is resized.
WindowRestoredEvent Raised when the window is restored from minimized state.
WindowShownEvent Raised when the window becomes visible again after being hidden.
Interfaces
IEventBus Abstraction for the engine's pub/sub event bus. Inject this interface (rather than the concrete EventBus) in scenes and systems to keep them testable and decoupled from the implementation.