Add blend modes to renderer.

This commit is contained in:
2024-10-15 17:10:48 +02:00
parent 851abd7c90
commit ecd752e961
5 changed files with 62 additions and 1 deletions

View File

@@ -2,6 +2,38 @@ using System.Numerics;
namespace Voile.Rendering
{
public enum BlendMode
{
//
// Summary:
// Blend textures considering alpha (default)
BlendAlpha,
//
// Summary:
// Blend textures adding colors
BlendAdditive,
//
// Summary:
// Blend textures multiplying colors
BlendMultiplied,
//
// Summary:
// Blend textures adding colors (alternative)
BlendAdd,
//
// Summary:
// Blend textures subtracting colors (alternative)
BlendSubtract,
//
// Summary:
// Blend premultiplied textures considering alpha
BlendAlphaPremul,
//
// Summary:
// Blend textures using custom src/dst factors (use rlSetBlendMode())
BlendCustom
}
/// <summary>
/// An abstract class representing the graphics renderer.
/// </summary>
@@ -82,6 +114,9 @@ namespace Voile.Rendering
/// </summary>
public abstract void EndFrame();
public abstract void BeginBlended(BlendMode blendMode);
public abstract void EndBlended();
public abstract void BeginCamera2d(Vector2 offset, Vector2 target, float rotation, float zoom);
public abstract void EndCamera2d();