GameLoop Class
Definition
Namespace: Brine2D.Engine
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.
Inheritance System.Object → GameLoop
| Properties | |
|---|---|
| IsRunning | Gets whether the game loop is currently running. |
| MaxDeltaTime | Maximum delta time per frame. Clamps large spikes caused by pauses or debugger breaks. Initialized from MaxDeltaTimeMs; can be changed at runtime. |
| TargetFramesPerSecond | Target frames per second. 0 = uncapped \(VSync or no frame limit\). Initialized from TargetFPS; can be changed at runtime. |
| Methods | |
|---|---|
| Run\(CancellationToken\) | Starts the game loop on the current thread. Blocks until the loop exits. Named Run rather than RunAsync intentionally: SDL3 requires all window and event operations on a single thread, so this must be synchronous. |