/// <summary> /// Dispose method to clean up the VAO releases the OpenGL Buffer /// </summary> public void Dispose() { if (!disposed) { ibo?.Dispose(); vbo?.Dispose(); GL.DeleteVertexArray(handle); GC.SuppressFinalize(this); disposed = true; } }
/// <summary> /// Adds a IBO object to the VAO needs to have one to draw, if a second is added it will replace the first and the first will be disposed of /// </summary> /// <param name="IBO">The IBO object to be added</param> public void SetIBO(IndexBufferObject IBO) { if (ibo != null) { UnBind(); ibo.Dispose(); Bind(); } ibo = IBO; ibo.Bind(); ibo.BufferData(); }