//---------------------------------------------------------------------
 public bool ReleaseIfDefaultPool()
 {
     if (d3dPool == Pool.Default)
     {
         if (d3dBuffer != null)
         {
             d3dBuffer.Dispose();
             d3dBuffer = null;
         }
         return(true);
     }
     return(false);
 }
Example #2
0
        /// <summary>
        /// Clears the buffers used.
        /// </summary>
        public void ClearBuffers()
        {
            if (_vb != null && !_vb.Disposed)
            {
                _vb.Dispose();
                _vb     = null;
                _vbSize = 0;
            }

            if (_vbVerts != null && !_vbVerts.Disposed)
            {
                _vbVerts.Dispose();
                _vbVerts    = null;
                _vbVertSize = 0;
            }

            if (_vbByHeight != null && !_vbByHeight.Disposed)
            {
                _vbByHeight.Dispose();
                _vbByHeight = null;
                _vbSize     = 0;
            }

            if (_ib != null && !_ib.Disposed)
            {
                _ib.Dispose();
                _ib     = null;
                _ibSize = 0;
            }

            if (_ibVerts != null && !_ibVerts.Disposed)
            {
                _ibVerts.Dispose();
                _ibVerts    = null;
                _ibVertSize = 0;
            }
        }
Example #3
0
 protected override void ReleaseManaged()
 {
     d3dVertexBuffer.Dispose();
 }