protected virtual void Dispose(bool disposing) { if (ID != 0) { Gl.DeleteBuffer(ID); ID = 0; } }
/// <summary> /// Deletes this buffer from GPU memory. /// </summary> public void Dispose() { if (vboID != 0) { Gl.DeleteBuffer(vboID); vboID = 0; } }
/// <summary> /// Deletes the vertex array from the GPU and will also dispose of any child VBOs if (DisposeChildren == true). /// </summary> public void Dispose() { // first try to dispose of the vertex array if (vaoID != 0) { Gl.DeleteVertexArrays(1, new uint[] { vaoID }); vaoID = 0; } // children must be disposed of separately since OpenGL 2.1 will not have a vertex array if (DisposeChildren) { for (int i = 0; i < vbos.Length; i++) { Gl.DeleteBuffer(vbos[i].vboID); } } }
protected virtual void Dispose(bool disposing) { // first try to dispose of the vertex array if (vaoID != 0) { Gl.DeleteVertexArrays(1, new uint[] { vaoID }); vaoID = 0; } // children must be disposed of separately since OpenGL 2.1 will not have a vertex array if (DisposeChildren) { for (int i = 0; i < vbos.Length; i++) { if (vbos[i].bufferTarget == BufferTarget.ElementArrayBuffer && !DisposeElementArray) { continue; } Gl.DeleteBuffer(vbos[i].vboID); } } }