daily update on 20231016 by nitload youmu, vao,vbo,ebo struct added

This commit is contained in:
Nitload
2023-10-17 01:22:30 +08:00
parent 6c3349f5a2
commit 614fabe26c
135 changed files with 28619 additions and 5432 deletions
+42
View File
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Graphics
{
internal unsafe struct VertexArray : IDisposable
{
internal uint _bufferID;
public VertexArray()
{
fixed (uint* id = &_bufferID)
{
Graphic.glGenVertexArrays(1, id);
}
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, _bufferID);
}
public VertexArray(int n)
{
fixed (uint* id = &_bufferID)
{
Graphic.glGenVertexArrays(n, id);
}
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, _bufferID);
}
public void Bind()
{
Graphic.glBindVertexArray(_bufferID);
}
public void Dispose()
{
fixed (uint* id = &_bufferID)
{
Graphic.glDeleteVertexArrays(1, id);
}
}
}
}