public virtual void Cleanup() { Context?.ClearState(); Context?.Flush(); BackBuffer?.Dispose(); BackBuffer = null; ZBuffer?.Dispose(); ZBuffer = null; RenderTargetViewRef?.Dispose(); RenderTargetViewRef = null; DepthStencilSRVRef?.Dispose(); DepthStencilSRVRef = null; DepthStencilViewRef?.Dispose(); DepthStencilViewRef = null; FactoryDWrite?.Dispose(); FactoryDWrite = null; Factory2D?.Dispose(); Factory2D = null; RenderTarget2D?.Dispose(); RenderTarget2D = null; Context?.Dispose(); DeviceRef?.Dispose(); DeviceRef = null; }
public void Dispose() { ImagingFactory.Dispose(); Factory2D.Dispose(); FontFactory.Dispose(); SwapChain.Dispose(); Device2D.Dispose(); DeviceContext.Dispose(); }
public void Dispose() { #if DEBUG _debug.ReportLiveDeviceObjects(ReportingLevel.Detail | ReportingLevel.IgnoreInternal); _debug.Dispose(); #endif Device.Dispose(); _swapChain.Dispose(); _backBuffer.Dispose(); _renderTarget.Dispose(); Context.Dispose(); Factory2D.Dispose(); FactoryDWrite.Dispose(); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } if (CurrentTextFormat != null) { CurrentTextFormat.Dispose(); } if (CurrentTextLayout != null) { CurrentTextLayout.Dispose(); } if (CustomTextRenderer != null) { CustomTextRenderer.Dispose(); } if (SceneColorBrush != null) { SceneColorBrush.Dispose(); } if (RenderTarget2D != null) { RenderTarget2D.Dispose(); } if (FactoryDWrite != null) { FactoryDWrite.Dispose(); } if (Factory2D != null) { Factory2D.Dispose(); } } base.Dispose(disposing); }
/// <summary> /// Release the unmanaged resources used by the <see cref="Direct3DSurface"/> and it's child controls and optionally releases the managed resources. /// </summary> /// <param name="disposing">True to release managed resources and unmanaged resources. False to only release unmanaged resources.</param> protected override void Dispose(bool disposing) { if (!disposing) { UnloadContent(); Factory2D.Dispose(); FactoryDirectWrite.Dispose(); FactoryDxgi.Dispose(); RenderTargetView.Dispose(); RenderTarget2D.Dispose(); _backBuffer.Dispose(); _swapChain.Dispose(); Context.Dispose(); _device.Dispose(); ProfileStats.Clear(); } base.Dispose(disposing); }