mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-23 20:14:37 +00:00
Unbind vao, vbo and ibo after data is set
This commit is contained in:
@@ -35,6 +35,7 @@ namespace PckStudio.Rendering
|
||||
_id = GL.GenBuffer();
|
||||
Bind();
|
||||
GL.BufferData(BufferTarget.ElementArrayBuffer, _indecies.Count * sizeof(int), _indecies.ToArray(), BufferUsageHint.StaticDraw);
|
||||
Unbind();
|
||||
}
|
||||
|
||||
public int GetCount() => _indecies.Count;
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace PckStudio.Rendering
|
||||
GL.VertexAttribPointer(i, element.Count, element.Type, element.Normalize, layout.GetStride(), offset);
|
||||
offset += element.Count * VertexBufferElement.GetStrideSize(element.Type);
|
||||
}
|
||||
Unbind();
|
||||
}
|
||||
|
||||
public void Bind()
|
||||
|
||||
@@ -20,12 +20,13 @@ namespace PckStudio.Rendering
|
||||
|
||||
public VertexBuffer(T[] data, int size)
|
||||
{
|
||||
_id = GL.GenBuffer();
|
||||
Bind();
|
||||
GL.BufferData(BufferTarget.ArrayBuffer, size, data, BufferUsageHint.StaticDraw);
|
||||
#if DEBUG
|
||||
__data = data;
|
||||
#endif
|
||||
_id = GL.GenBuffer();
|
||||
Bind();
|
||||
GL.BufferData(BufferTarget.ArrayBuffer, size, data, BufferUsageHint.StaticDraw);
|
||||
Unbind();
|
||||
}
|
||||
|
||||
public void Bind()
|
||||
@@ -33,7 +34,6 @@ namespace PckStudio.Rendering
|
||||
GL.BindBuffer(BufferTarget.ArrayBuffer, _id);
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
public void Unbind()
|
||||
{
|
||||
GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
|
||||
|
||||
Reference in New Issue
Block a user