/// <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; }
/// <summary> /// Sets an index buffer as the current buffer /// </summary> /// <param name="indices">Index buffer to set. Pass this as null to disable index buffer</param> public void SetIndexBuffer(OpenGL.IIndexBuffer indices) { if (index_buffer != null) index_buffer.MakeNonCurrent(); if (indices != null) indices.MakeCurrent(); index_buffer = indices; }