2020-08-09 16:29:46 +08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
namespace Strawberry
|
|
|
|
{
|
|
|
|
public class Batcher
|
|
|
|
{
|
|
|
|
List<Batch> batchStack = new System.Collections.List<Batch>() ~ DeleteContainerAndItems!(_);
|
|
|
|
|
|
|
|
Batch top => batchStack.Count > 0 ? batchStack[batchStack.Count - 1] : null;
|
|
|
|
|
2020-08-10 09:28:55 +08:00
|
|
|
public void PushQuad(Vertex a, Vertex b, Vertex c, Vertex d)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-08-09 16:29:46 +08:00
|
|
|
private class Batch
|
|
|
|
{
|
2020-08-10 09:28:55 +08:00
|
|
|
uint32 bufferHandle;
|
|
|
|
|
|
|
|
List<Vertex> Vertices;
|
2020-08-09 16:29:46 +08:00
|
|
|
|
2020-08-10 09:28:55 +08:00
|
|
|
public this()
|
|
|
|
{
|
|
|
|
GL.glGenBuffers(1, &bufferHandle);
|
|
|
|
GL.glBindBuffer(GL.GL_ARRAY_BUFFER, bufferHandle);
|
|
|
|
GL.glDeleteBuffers(1, &bufferHandle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private struct Vertex
|
|
|
|
{
|
|
|
|
public Vector Position;
|
|
|
|
public Color Color;
|
2020-08-09 16:29:46 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|