コード例 #1
0
 public void Dispose()
 {
     if (_vbo != null)
     {
         _vbo.Dispose();
         _vbo = null;
     }
 }
コード例 #2
0
 void InitMultiPartVBOIfNeed()
 {
     if (_vbo != null)
     {
         return;
     }
     //
     _vbo = new VertexBufferObject();
     _vbo.CreateBuffers(_allCoords.ToArray(), _allArrayIndexList.ToArray(), _partIndexList.ToArray());
 }
コード例 #3
0
 /// <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);
 }
コード例 #4
0
        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.
        }
コード例 #5
0
 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
 }
コード例 #6
0
 public VBOPart(VertexBufferObject vbo, PartRange partRange)
 {
     this.vbo       = vbo;
     this.partRange = partRange;
 }