public void Dispose() { if (_vbo != null) { _vbo.Dispose(); _vbo = null; } }
void InitMultiPartVBOIfNeed() { if (_vbo != null) { return; } // _vbo = new VertexBufferObject(); _vbo.CreateBuffers(_allCoords.ToArray(), _allArrayIndexList.ToArray(), _partIndexList.ToArray()); }
/// <summary> /// vertex buffer of the solid area part /// </summary> public VertexBufferObject GetAreaTessAsVBO(TessTool tess) { if (_vboArea == null) { //tess indexListArray = tess.TessAsTriIndexArray(coordXYs, null, out tessXYCoords2, out this._tessAreaVertexCount); _vboArea = new VertexBufferObject(); _vboArea.CreateBuffers(tessXYCoords2, indexListArray, null); } return(_vboArea); }
public void FillTriangles(VertexBufferObject vbo, int nelements, Drawing.Color color) { SetCurrent(); CheckViewMatrix(); //-------------------------------------------- u_solidColor.SetValue((float)color.R / 255f, (float)color.G / 255f, (float)color.B / 255f, (float)color.A / 255f); vbo.Bind(); a_position.LoadLatest(); GL.DrawElements(BeginMode.Triangles, nelements, DrawElementsType.UnsignedShort, 0); vbo.UnBind(); //important, call unbind after finish call. }
public void BuildBuffer(bool clearInputXYs = true) { if (_vbo != null) { //must clear this first throw new System.Exception(); } //---------------- _vbo = new VertexBufferObject(); _vbo.CreateBuffers(_mergedInputXYs.ToArray(), null); if (clearInputXYs) { _mergedInputXYs.Clear(); _mergedInputXYs = null; } //clear _mergedInputXYs }
public VBOPart(VertexBufferObject vbo, PartRange partRange) { this.vbo = vbo; this.partRange = partRange; }