gl viewport

This commit is contained in:
bird_egop
2026-06-05 20:33:21 +03:00
parent 97dc14c36c
commit 195e6d71bd
13 changed files with 1140 additions and 0 deletions
@@ -0,0 +1,36 @@
using Silk.NET.OpenGL;
namespace NResUI.Rendering.Viewport.Meshes;
public sealed class GpuMesh
{
private readonly GL _gl;
public uint VertexArrayObject { get; }
public uint VertexBufferObject { get; }
public uint ElementBufferObject { get; }
public uint IndexCount { get; }
public PrimitiveType PrimitiveType { get; }
public GpuMesh(
GL gl,
uint vertexArrayObject,
uint vertexBufferObject,
uint elementBufferObject,
uint indexCount,
PrimitiveType primitiveType = PrimitiveType.Triangles)
{
_gl = gl;
VertexArrayObject = vertexArrayObject;
VertexBufferObject = vertexBufferObject;
ElementBufferObject = elementBufferObject;
IndexCount = indexCount;
PrimitiveType = primitiveType;
}
public void Draw()
{
_gl.BindVertexArray(VertexArrayObject);
_gl.DrawElements(PrimitiveType, IndexCount, DrawElementsType.UnsignedInt, null);
}
}