protected virtual void Dispose(bool disposing) { // first try to dispose of the vertex array if (ID != 0) { Gl.DeleteVertexArray(ID); ID = 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; } vbos[i].Dispose(); } } }