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.
            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;
        }
Beispiel #2
0
 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;
 }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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;
        }
Beispiel #5
0
        public void Shutdown()
        {
            // Before shutting down set to windowed mode or when you release the swap chain it will throw an exception.
            if (SwapChain != null)
            {
                SwapChain.SetFullscreenState(false, null);
            }

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

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

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

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

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

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

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

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

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

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