Another restructure with code updates.

Updated RectTextrue.cs, VertexInformation.cs, and IDrawable.cs to properly pass indice information.
This commit is contained in:
2020-02-20 18:07:17 -05:00
parent 1a9ff8a26f
commit 519d31f2e1
38 changed files with 62 additions and 10 deletions

View File

@@ -0,0 +1,32 @@
using System;
using OpenTK.Graphics.OpenGL;
namespace RecrownedGTK.Graphics {
public class VertexBufferArrayHandle : IDisposable {
private bool disposed;
private int handle;
public VertexBufferArrayHandle() {
handle = GL.GenBuffer();
}
public void Bind() {
GL.BindBuffer(BufferTarget.ArrayBuffer, handle);
}
public void Flush(float[] vertices, BufferUsageHint hint = BufferUsageHint.StaticDraw) {
GL.BufferData(BufferTarget.ArrayBuffer, vertices.Length * sizeof(float), vertices, hint);
}
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing) {
if (disposed) return;
if (disposing) {
}
GL.DeleteBuffer(handle);
disposed = true;
}
~VertexBufferArrayHandle() {
Dispose(false);
}
}
}