Files
StrawberryBF/src/PlatformLayer/Batcher.bf

21 lines
547 B
Beef
Raw Normal View History

2020-08-09 01:29:46 -07:00
namespace Strawberry
{
public abstract class Batcher
2020-08-09 01:29:46 -07:00
{
public abstract void Draw();
2020-08-14 18:40:07 -07:00
protected abstract void PushQuad(Vertex a, Vertex b, Vertex c, Vertex d);
protected abstract void PushTri(Vertex a, Vertex b, Vertex c);
2020-08-14 18:40:07 -07:00
public void Rect(float x, float y, float w, float h, Color color)
2020-08-09 01:29:46 -07:00
{
PushQuad(.Shape(.(x, y), color), .Shape(.(x + w, y), color), .Shape(.(x + w, y + h), color), .Shape(.(x, y + h), color));
2020-08-09 18:28:55 -07:00
}
public void Rect(Rect rect, Color color)
2020-08-09 18:28:55 -07:00
{
Rect(rect.X, rect.Y, rect.Width, rect.Height, color);
2020-08-09 01:29:46 -07:00
}
}
}