More nullable fixes, make SetTransform a part of base Renderer.

This commit is contained in:
2024-01-21 17:58:11 +01:00
parent 5f4e32e2e0
commit 5bb16350f3
8 changed files with 59 additions and 59 deletions

View File

@@ -79,13 +79,25 @@ namespace DaggerFramework.Rendering
/// <param name="color">Background color.</param>
public abstract void ClearBackground(Color color);
public void ResetTransform()
{
transformPosition = Vector2.Zero;
transformOffset = Vector2.Zero;
transformRotation = 0.0f;
}
/// <summary>
/// Sets transforms for the next draw operation.
/// </summary>
/// <param name="position">Global transform position.</param>
/// <param name="offset">Local offset point around which shapes will rotate.</param>
/// <param name="rotation">Rotation.</param>
public abstract void SetTransform(Vector2 position, Vector2 offset, float rotation = 0.0f);
public void SetTransform(Vector2 position, Vector2 offset, float rotation = 0.0f)
{
transformPosition = position;
transformOffset = offset;
transformRotation = rotation;
}
/// <summary>
/// Sets the transform for the next draw operation.
/// </summary>
@@ -127,6 +139,9 @@ namespace DaggerFramework.Rendering
/// <param name="id">Texture to draw.</param>
/// <param name="tint">Texture tint.</param>
public abstract void DrawTexture(Texture2d texture, Color tint);
protected Vector2 transformPosition, transformOffset;
protected float transformRotation;
}
public enum Msaa