DrawQuad with transform matrix

This commit is contained in:
Simon Lübeß
2021-12-30 16:18:43 +01:00
parent 1cc37ee168
commit b3ab30e72a
+12
View File
@@ -587,6 +587,18 @@ namespace GlitchyEngine.Renderer
}
}
public static void DrawQuad(Matrix transform, Texture2D texture, ColorRGBA color = .White, Vector4 uvTransform = .(0, 0, 1, 1))
{
Log.EngineLogger.AssertDebug(s_sceneRunning, "Missing call of BeginScene.");
QueueQuadInstance(transform, color, texture, transform.Translation.Z, uvTransform);
if(s_drawOrder == .Immediate)
{
DrawDeferred();
}
}
public static void DrawQuadPivotCorner(Vector3 position, Vector2 size, float rotation, Texture2D texture, ColorRGBA color = .White, Vector4 uvTransform = .(0, 0, 1, 1))
{
DrawQuad(position + Vector3(size.X / 2, size.Y / -2, 0), size, rotation, texture, color, uvTransform);