SDL3Renderer Class

SDL3 GPU API implementation of the renderer.

internal sealed class SDL3Renderer : Brine2D.Rendering.IRenderer, Brine2D.Rendering.IDrawContext, System.IDisposable, Brine2D.Common.ISDL3WindowProvider, Brine2D.Rendering.ITextureContext

Inheritance System.Object → SDL3Renderer

Implements IRenderer, IDrawContext, System.IDisposable, ISDL3WindowProvider, ITextureContext

Methods
ApplyPostProcessing() Applies post-processing effects to the current frame. Only works if post-processing is enabled via options.
BeginFrame() Begins a new frame. Silently returns (no-op) when the renderer is not initialized, suspended, or unable to acquire GPU resources. Draw calls issued without a successful BeginFrame() are dropped.
DrainPendingUploads() Releases all pending upload resources unconditionally. The caller must ensure SDL3.SDL.WaitForGPUIdle(System.IntPtr) has completed before calling this method so that all fences are already signaled.
DrawTexture(ITexture, float, float) Draw texture at position (float x, y, top-left anchor).
DrawTexture(ITexture, float, float, float, float) Draw texture at position with explicit width/height (top-left anchor).
DrawTexture(ITexture, Vector2) Draw texture at position (Vector2, top-left anchor).
DrawTexture(ITexture, Vector2, Nullable<Rectangle>, Nullable<Vector2>, float, Nullable<Vector2>, Nullable<Color>, SpriteFlip) Draw a texture with full control over transform, origin, scale, and flip.
EndFrame() Ends the current frame and submits the command buffer. Silently returns (no-op) when the renderer is not initialized or disposed. When suspended, pending draw calls are discarded but the command buffer is still submitted so GPU resources are not leaked.
OnWindowResized(WindowResizedEvent)
PopRenderTarget() Pop the current render target from the stack.
PushRenderTarget(IRenderTarget) Push the current render target onto a stack and set a new one. Useful for nested render-to-texture operations.
RenderGlyphs(ReadOnlySpan<char>, float, float, Color, ITexture, float, float, float, float, bool, float, Action<float,float,float>, Nullable<float>)