From 8f4f1a3c24f89b89bf86738f65433565e12af012 Mon Sep 17 00:00:00 2001 From: dnesov Date: Thu, 17 Oct 2024 02:25:49 +0200 Subject: [PATCH] Add more documentation to RenderSystem. --- Voile/Source/Rendering/RenderSystem.cs | 33 +++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Voile/Source/Rendering/RenderSystem.cs b/Voile/Source/Rendering/RenderSystem.cs index bd66c83..936c288 100644 --- a/Voile/Source/Rendering/RenderSystem.cs +++ b/Voile/Source/Rendering/RenderSystem.cs @@ -118,9 +118,20 @@ namespace Voile.Rendering /// public abstract void EndFrame(); + /// + /// Begin drawing with texture blending. + /// + /// Type of texture blending. public abstract void BeginBlended(BlendMode blendMode); public abstract void EndBlended(); + /// + /// Begins drawing using a 2D camera. + /// + /// + /// + /// + /// public abstract void BeginCamera2d(Vector2 offset, Vector2 target, float rotation, float zoom); public abstract void EndCamera2d(); @@ -130,6 +141,9 @@ namespace Voile.Rendering /// Background color. public abstract void ClearBackground(Color color); + /// + /// Resets all transform operations. + /// public void ResetTransform() { transformPosition = Vector2.Zero; @@ -182,6 +196,12 @@ namespace Voile.Rendering /// Color of the text. public abstract void DrawSdfText(string text, int fontSize, Color color); + /// + /// Draw text using a rasterized font resource. + /// + /// Rasterized font. + /// Text to draw. + /// Color of the text. public abstract void DrawText(ResourceRef font, string text, Color color); /// @@ -195,6 +215,9 @@ namespace Voile.Rendering protected float transformRotation; } + /// + /// Quality of MSAA anti-aliasing. + /// public enum Msaa { None, @@ -202,6 +225,9 @@ namespace Voile.Rendering Msaa4x, Msaa8x } + /// + /// Settings for the renderer. + /// public struct RendererSettings { public Msaa Msaa; @@ -220,7 +246,9 @@ namespace Voile.Rendering WindowSettings = WindowSettings.Default }; } - + /// + /// Settings for window. + /// public struct WindowSettings { public string Title; @@ -233,6 +261,9 @@ namespace Voile.Rendering Size = size; } + /// + /// Default window settings. + /// public static WindowSettings Default => new("Voile Game", new Vector2(1280, 720)); } } \ No newline at end of file