public void AttachVertexBuffer(VertexBufferObject <TVertex> buffer, VertexBufferObject <uint> indices = null) { if (0 == handle) { throw new NotInitializedException(); } vertexBuffer?.Dispose(); vertexBuffer = buffer; indexBuffer?.Dispose(); indexBuffer = indices; Bind(); vertexBuffer.Bind(); indexBuffer?.Bind(); SetupAttributes(); Unbind(); vertexBuffer.Unbind(); indexBuffer?.Unbind(); }