More nullable fixes, make SetTransform a part of base Renderer.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user