Add GL_UNSIGNED_INT

This commit is contained in:
H. Utku Maden 2023-06-29 10:31:46 +03:00
parent 46c18d97d2
commit fe71028573
2 changed files with 8 additions and 4 deletions

@ -18,6 +18,7 @@ namespace Quik.OpenGL
GL_UNSIGNED_BYTE = 0x1401, GL_UNSIGNED_BYTE = 0x1401,
GL_UNSIGNED_SHORT = 0x1403, GL_UNSIGNED_SHORT = 0x1403,
GL_UNSIGNED_INT = 0x1405,
GL_FLOAT = 0x1406, GL_FLOAT = 0x1406,
GL_RED = 0x1903, GL_RED = 0x1903,

@ -1,16 +1,16 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace Quik.VertexGenerator namespace Quik.VertexGenerator
{ {
public class DrawQueue public class DrawQueue : IEnumerable<DrawCall>
{ {
private readonly RefList<QuikVertex> _vertices = new RefList<QuikVertex>(); private readonly RefList<QuikVertex> _vertices = new RefList<QuikVertex>();
private readonly RefList<int> _elements = new RefList<int>(); private readonly RefList<int> _elements = new RefList<int>();
private readonly List<DrawCall> _drawCalls = new List<DrawCall>(); private readonly List<DrawCall> _drawCalls = new List<DrawCall>();
private int _start; private int _start;
private int _count;
private int _baseOffset; private int _baseOffset;
private QuikRectangle _bounds; private QuikRectangle _bounds;
private QuikTexture _texture; private QuikTexture _texture;
@ -35,7 +35,6 @@ namespace Quik.VertexGenerator
public void StartDrawCall(in QuikRectangle bounds, QuikTexture texture, int baseOffset) public void StartDrawCall(in QuikRectangle bounds, QuikTexture texture, int baseOffset)
{ {
_start = ElementCount; _start = ElementCount;
_count = 0;
_texture = texture; _texture = texture;
_bounds = bounds; _bounds = bounds;
_baseOffset = baseOffset; _baseOffset = baseOffset;
@ -87,8 +86,12 @@ namespace Quik.VertexGenerator
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void EndDrawCall() 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<DrawCall> GetEnumerator() => _drawCalls.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => _drawCalls.GetEnumerator();
} }
public struct DrawCall public struct DrawCall