IDrawContext Interface

Drawing operations surface for Brine2D renderers. Consumers that only need to draw shapes, textures, and text should depend on this interface rather than the full IRenderer.

public interface IDrawContext

Derived
HeadlessRenderer
IRenderer
SDL3Renderer

Methods
DrawText(string, float, float, Color) Draw plain text at the specified position.
DrawText(string, float, float, TextRenderOptions) Draw text with advanced formatting options.
DrawTexture(ITexture, float, float) Draw texture at position (float x, y, top-left).
DrawTexture(ITexture, float, float, float, float) Draw texture with explicit size (top-left).
DrawTexture(ITexture, Vector2) Draw texture at position (Vector2, top-left).
DrawTexture(ITexture, Vector2, Nullable<Rectangle>, Nullable<Vector2>, float, Nullable<Vector2>, Nullable<Color>, SpriteFlip) Draw a texture with full control (primary API).
GetBlendMode() Get the current blend mode.
GetRenderLayer() Gets the current render layer.
MeasureText(string, TextRenderOptions) Measure the size of text with full layout options.
MeasureText(string, Nullable<float>) Measure the size of plain text.
SetDefaultFont(IFont) Set the default font for text rendering.
SetRenderLayer(byte) Sets the render layer for subsequent draw calls.