using Engine.Graphics.Pipeline;
using Engine.Graphics.Texture;
using OpenTK.Mathematics;

namespace Engine.Scene.Component.BuiltIn.Renderer;

public class Box2DRenderer : Component
{
  public ref Vector4 Color => ref _color;
  public Texture? Texture { get; set; } = null;
  public RenderLayer RenderLayer { get; set; } = RenderLayer.DEFAULT;

  private Vector4 _color = Vector4.One;

  public override void Render()
  {
    Engine.Instance.Renderer[RenderLayer].QuadRenderer
      .Commit(GameObject.Transform.FullTransformMatrix, Color, Texture);
  }
}