/// <summary> /// Sets a vertex buffer as the current buffer. /// </summary> /// <param name="vert">Vertex buffer to set. Pass this as null to disable vertex buffer</param> public void SetVertexBuffer(OpenGL.IVertexBuffer vert) { if (vertex_buffer != null) { vertex_buffer.MakeNonCurrent(); } if (vert != null) { // Apply shader attributes for this vertex buffer if (active_shader != null && active_shader is StdMaterial) { vert.ApplyStdMaterial(active_shader as StdMaterial); } // Bind vertex buffer vert.MakeCurrent(); } vertex_buffer = vert; }