SDL3Lifecycle(ILogger) Constructor
Definition¶
Namespace: Brine2D.Rendering
Owns the SDL3 process-level lifetime.
- Microsoft.Extensions.Hosting.IHostedService.StartAsync(System.Threading.CancellationToken) calls SDL_Init before any SDL-dependent service is resolved.
- System.IDisposable.Dispose calls SDL_Quit during DI LIFO teardown, after all SDL-dependent
singletons have been disposed.
SDL_Quit intentionally lives in Brine2D.Rendering.SDL3Lifecycle.Dispose, not Microsoft.Extensions.Hosting.IHostedService.StopAsync(System.Threading.CancellationToken),
because StopAsync runs before DI disposal — calling it there would pull the rug from under
services like AudioService that release SDL resources in their own System.IDisposable.Dispose.
public SDL3Lifecycle(Microsoft.Extensions.Logging.ILogger<Brine2D.Rendering.SDL3Lifecycle> logger);