Fixed issue with incorrect delegate signature.

This commit is contained in:
2020-06-01 16:31:56 -05:00
parent e59e78e08c
commit 484dbbece3
11 changed files with 227 additions and 130 deletions

View File

@@ -22,7 +22,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
private uint dataIndex, indicesIndex, lengthsIndex;
public Batch(uint BatchVertexSize = 4096) {
multiDrawElements = GLFunctionUtils.RetrieveGLDelegate<GLMultiDrawElements>("glMultDrawElements");
multiDrawElements = GLFunctionUtils.RetrieveGLDelegate<GLMultiDrawElements>("glMultiDrawElements");
indices = new uint[BatchVertexSize];
lengths = new uint[BatchVertexSize];
offsets = new uint[BatchVertexSize];
@@ -50,7 +50,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
vertexArray.Dispose();
}
public virtual void Draw(IMeshable meshable, Color color) {
public virtual void Add(IMeshable meshable, Color color) {
ValueTuple<Vector3, Vector2>[] vertices = meshable.Vertices;
uint[] indices = meshable.Elements;
if (vertices.Length * VERTEX_LENGTH + dataIndex >= data.Length || indices.Length + indicesIndex >= indicesIndex) Flush();
@@ -93,7 +93,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
dataIndex = 0;
indicesIndex = 0;
lengthsIndex = 0;
multiDrawElements(GLEnums.GL_TRIANGLE_STRIP, lengths, GLEnums.GL_UNSIGNED_INT, offsets);
multiDrawElements(GLEnums.GL_TRIANGLE_STRIP, lengths, GLEnums.GL_UNSIGNED_INT, IntPtr.Zero, lengths.Length);
}
}
}