public void ShutDown() { SwapChain?.SetFullscreenState(false, null); AlphaEnableBlendingState?.Dispose(); AlphaEnableBlendingState = null; AlphaDisableBlendingState?.Dispose(); AlphaDisableBlendingState = null; DepthDisabledStencilState?.Dispose(); DepthDisabledStencilState = null; RasterState?.Dispose(); RasterState = null; RasterStateNoCulling?.Dispose(); RasterStateNoCulling = null; RasterStateWirefram?.Dispose(); RasterStateWirefram = null; DepthStencilView?.Dispose(); DepthStencilView = null; DepthStencilState?.Dispose(); DepthStencilState = null; DepthStencilBuffer?.Dispose(); DepthStencilBuffer = null; RenderTargetView?.Dispose(); RenderTargetView = null; DeviceContext?.Dispose(); DeviceContext = null; Device?.Dispose(); Device = null; SwapChain?.Dispose(); SwapChain = null; }
public void ShutDown() { // Before shutting down set to windowed mode or when you release the swap chain it will throw an exception. SwapChain?.SetFullscreenState(false, null); // Dispose of all objects. AlphaEnableBlendingState?.Dispose(); AlphaEnableBlendingState = null; AlphaDisableBlendingState?.Dispose(); AlphaDisableBlendingState = null; DepthDisabledStencilState?.Dispose(); DepthDisabledStencilState = null; RasterState?.Dispose(); RasterState = null; DepthStencilView?.Dispose(); DepthStencilView = null; DepthStencilState?.Dispose(); DepthStencilState = null; DepthStencilBuffer?.Dispose(); DepthStencilBuffer = null; RenderTargetView?.Dispose(); RenderTargetView = null; DeviceContext?.Dispose(); DeviceContext = null; Device?.Dispose(); Device = null; SwapChain?.Dispose(); SwapChain = null; }
public void ShutDown() { // Before shutting down set to windowed mode or when you release the swap chain it will throw an exception. SwapChain?.SetFullscreenState(false, null); RasterState?.Dispose(); RasterState = null; depthStencilState?.Dispose(); depthStencilState = null; DepthStencilBuffer?.Dispose(); DepthStencilBuffer = null; _depthStencilView?.Dispose(); _depthStencilView = null; _renderTargetView?.Dispose(); _renderTargetView = null; DeviceContext?.Dispose(); Device?.Dispose(); SwapChain?.Dispose(); AlphaEnableBlendingState?.Dispose(); AlphaEnableBlendingState = null; AlphaDisableBlendingState?.Dispose(); AlphaDisableBlendingState = null; DepthDisabledStencilState?.Dispose(); DepthDisabledStencilState = null; //DepthStencilView?.Dispose(); //DepthStencilView = null; DepthStencilState?.Dispose(); DepthStencilState = null; DepthStencilBuffer?.Dispose(); DepthStencilBuffer = null; if (main_thread_update != null) { //main_thread_update.Suspend(); main_thread_update = null; } ShutDownGraphics(); }
public void Dispose() { _swapChain?.SetFullscreenState(false, null); AlphaAdditiveBlendState2?.Dispose(); AlphaAdditiveBlendState2 = null; AlphaEnableBlendingState?.Dispose(); AlphaEnableBlendingState = null; AlphaDisableBlendingState?.Dispose(); AlphaDisableBlendingState = null; DepthDisabledStencilState?.Dispose(); DepthDisabledStencilState = null; _rasterState?.Dispose(); _rasterState = null; _depthStencilView?.Dispose(); _depthStencilView = null; DepthStencilState?.Dispose(); DepthStencilState = null; _depthStencilBuffer?.Dispose(); _depthStencilBuffer = null; _renderTargetView?.Dispose(); _renderTargetView = null; DeviceContext?.Dispose(); DeviceContext = null; Device?.Dispose(); Device = null; _swapChain?.Dispose(); _swapChain = null; }