diff --git a/Quik/OpenGL/GLEnum.cs b/Quik/OpenGL/GLEnum.cs index 296f8b5..edd1ff0 100644 --- a/Quik/OpenGL/GLEnum.cs +++ b/Quik/OpenGL/GLEnum.cs @@ -18,6 +18,7 @@ namespace Quik.OpenGL GL_UNSIGNED_BYTE = 0x1401, GL_UNSIGNED_SHORT = 0x1403, + GL_UNSIGNED_INT = 0x1405, GL_FLOAT = 0x1406, GL_RED = 0x1903, diff --git a/Quik/VertexGenerator/DrawQueue.cs b/Quik/VertexGenerator/DrawQueue.cs index a905bd1..c498aed 100644 --- a/Quik/VertexGenerator/DrawQueue.cs +++ b/Quik/VertexGenerator/DrawQueue.cs @@ -1,16 +1,16 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Runtime.CompilerServices; namespace Quik.VertexGenerator { - public class DrawQueue + public class DrawQueue : IEnumerable { private readonly RefList _vertices = new RefList(); private readonly RefList _elements = new RefList(); private readonly List _drawCalls = new List(); private int _start; - private int _count; private int _baseOffset; private QuikRectangle _bounds; private QuikTexture _texture; @@ -35,7 +35,6 @@ namespace Quik.VertexGenerator public void StartDrawCall(in QuikRectangle bounds, QuikTexture texture, int baseOffset) { _start = ElementCount; - _count = 0; _texture = texture; _bounds = bounds; _baseOffset = baseOffset; @@ -87,8 +86,12 @@ namespace Quik.VertexGenerator [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EndDrawCall() { - _drawCalls.Add(new DrawCall(_start, _count, _bounds, _texture)); + int count = ElementCount - _start; + _drawCalls.Add(new DrawCall(_start, count, _bounds, _texture)); } + + public IEnumerator GetEnumerator() => _drawCalls.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => _drawCalls.GetEnumerator(); } public struct DrawCall