예제 #1
0
        protected override void Destroy()
        {
            for (int i = 0; i < VertexBufferCount; i++)
            {
                vertexBuffers[i].Dispose();
            }

            activeVertexBufferIndex = -1;

            mappedVertexBufferPointer = IntPtr.Zero;

            if (indexBuffer != null)
            {
                indexBuffer.Dispose();
                indexBuffer = null;
            }

            indexBufferBinding = null;
            pipelineState      = null;

            if (simpleEffect != null)
            {
                simpleEffect.Dispose();
                simpleEffect = null;
            }

            for (int i = 0; i < VertexBufferCount; i++)
            {
                inputElementDescriptions[i] = null;
            }

            charsToRenderCount = -1;

            base.Destroy();
        }
예제 #2
0
 public override void Cancel()
 {
     streamOutBufferBinding.Buffer.Dispose();
     transformBuffer.Dispose();
     colorBuffer.Dispose();
     streamShader.Dispose();
 }
예제 #3
0
 public void Dispose()
 {
     if (_isDisposed)
     {
         return;
     }
     EffectInstance.Dispose();
     Effect.Dispose();
     _isDisposed = true;
 }
 void IDisposable.Dispose()
 {
     effectInstance?.Dispose(); effectInstance = null;
     if (linesBuffer != indexLinesBuffer && linesBuffer != indexPointsBuffer)
     {
         linesBuffer?.Dispose();
     }
     linesBuffer = null; linesCount = 0;
     triangleBuffer?.Dispose(); triangleBuffer = null; triangleCount = 0;
     vertexFormat?.Dispose();   vertexFormat   = null;
     vertexBuffer?.Dispose();   vertexBuffer   = null; vertexCount = 0;
 }
예제 #5
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public override void Dispose()
        {
            if (VertexBuffer != null && !VertexBuffer.IsDisposed)
            {
                VertexBuffer.Dispose();
            }

            if (effect != null && !effect.IsDisposed)
            {
                effect.Dispose();
            }
        }
예제 #6
0
        public void Dispose()
        {
            DeallocateTextureViewsForMipMaps();
            renderTargetMipMaps = null;

            effectDecoderTextureCopy?.Dispose();
            effectDecoderTextureCopy = null;

            effectTexture2DCopy?.Dispose();
            effectTexture2DCopy = null;

            renderTargetTexture?.Dispose();
            renderTargetTexture = null;

            minMagLinearMipPointSampler?.Dispose();
            minMagLinearMipPointSampler = null;
        }