Add more documentation to RenderSystem.

This commit is contained in:
2024-10-17 02:25:49 +02:00
parent c21e275b6d
commit 8f4f1a3c24

View File

@@ -118,9 +118,20 @@ namespace Voile.Rendering
/// </summary> /// </summary>
public abstract void EndFrame(); public abstract void EndFrame();
/// <summary>
/// Begin drawing with texture blending.
/// </summary>
/// <param name="blendMode">Type of texture blending.</param>
public abstract void BeginBlended(BlendMode blendMode); public abstract void BeginBlended(BlendMode blendMode);
public abstract void EndBlended(); public abstract void EndBlended();
/// <summary>
/// Begins drawing using a 2D camera.
/// </summary>
/// <param name="offset"></param>
/// <param name="target"></param>
/// <param name="rotation"></param>
/// <param name="zoom"></param>
public abstract void BeginCamera2d(Vector2 offset, Vector2 target, float rotation, float zoom); public abstract void BeginCamera2d(Vector2 offset, Vector2 target, float rotation, float zoom);
public abstract void EndCamera2d(); public abstract void EndCamera2d();
@@ -130,6 +141,9 @@ namespace Voile.Rendering
/// <param name="color">Background color.</param> /// <param name="color">Background color.</param>
public abstract void ClearBackground(Color color); public abstract void ClearBackground(Color color);
/// <summary>
/// Resets all transform operations.
/// </summary>
public void ResetTransform() public void ResetTransform()
{ {
transformPosition = Vector2.Zero; transformPosition = Vector2.Zero;
@@ -182,6 +196,12 @@ namespace Voile.Rendering
/// <param name="color">Color of the text.</param> /// <param name="color">Color of the text.</param>
public abstract void DrawSdfText(string text, int fontSize, Color color); public abstract void DrawSdfText(string text, int fontSize, Color color);
/// <summary>
/// Draw text using a rasterized font resource.
/// </summary>
/// <param name="font">Rasterized font.</param>
/// <param name="text">Text to draw.</param>
/// <param name="color">Color of the text.</param>
public abstract void DrawText(ResourceRef<Font> font, string text, Color color); public abstract void DrawText(ResourceRef<Font> font, string text, Color color);
/// <summary> /// <summary>
@@ -195,6 +215,9 @@ namespace Voile.Rendering
protected float transformRotation; protected float transformRotation;
} }
/// <summary>
/// Quality of MSAA anti-aliasing.
/// </summary>
public enum Msaa public enum Msaa
{ {
None, None,
@@ -202,6 +225,9 @@ namespace Voile.Rendering
Msaa4x, Msaa4x,
Msaa8x Msaa8x
} }
/// <summary>
/// Settings for the renderer.
/// </summary>
public struct RendererSettings public struct RendererSettings
{ {
public Msaa Msaa; public Msaa Msaa;
@@ -220,7 +246,9 @@ namespace Voile.Rendering
WindowSettings = WindowSettings.Default WindowSettings = WindowSettings.Default
}; };
} }
/// <summary>
/// Settings for window.
/// </summary>
public struct WindowSettings public struct WindowSettings
{ {
public string Title; public string Title;
@@ -233,6 +261,9 @@ namespace Voile.Rendering
Size = size; Size = size;
} }
/// <summary>
/// Default window settings.
/// </summary>
public static WindowSettings Default => new("Voile Game", new Vector2(1280, 720)); public static WindowSettings Default => new("Voile Game", new Vector2(1280, 720));
} }
} }