internal void ReleaseDevices()
 {
     IsRendererSuppressed = true;
     RenderTarget.Dispose();
     Backbuffer.Dispose();
     RenderTargetSurface.Dispose();
     RenderTargetView.Dispose();
     D2DDeviceContext.Dispose();
     D2DDevice.Dispose();
     D2DFactory.Dispose();
     DXGIDevice.Dispose();
     D3DDevice.Dispose();
     D3DDefaultDevice.Dispose();
     SwapChain.Dispose();
     SwapChain           = null;
     RenderTarget        = null;
     RenderTargetSurface = null;
     Backbuffer          = null;
     RenderTargetView    = null;
     D2DDeviceContext    = null;
     D2DFactory          = null;
     D2DDevice           = null;
     DXGIDevice          = null;
     D3DDevice           = null;
     D3DDefaultDevice    = null;
 }
Esempio n. 2
0
        public void Dispose()
        {
            if (_rtv != null)
            {
                _rtv.Dispose();
            }
            _rtv = null;

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

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

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

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

            _width  = 0;
            _height = 0;
        }
Esempio n. 3
0
        public void Shutdown()
        {
            if (_deviceContext != null)
            {
                _deviceContext.Dispose();
                _deviceContext = null;
            }

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

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

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

            if (_default3DDevice != null)
            {
                _default3DDevice.Dispose();
                _default3DDevice = null;
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Dispose all the created objects.
 /// </summary>
 public void Uninitialize()
 {
     radialGradientBrush.Dispose();
     linearGradientBrush.Dispose();
     solidBrush.Dispose();
     swapChain.Dispose();
     d2dTarget.Dispose();
     d3dContext.Dispose();
     d2dContext.Dispose();
     device.Dispose();
 }
Esempio n. 5
0
 /// <summary>
 /// Dispose all the created objects.
 /// </summary>
 public void Uninitialize()
 {
     textLayout2.Dispose();
     textLayout1.Dispose();
     textFormat.Dispose();
     backgroundBrush.Dispose();
     textBrush.Dispose();
     swapChain.Dispose();
     d2dTarget.Dispose();
     d3dContext.Dispose();
     d2dContext.Dispose();
     device.Dispose();
 }
Esempio n. 6
0
        public void Dispose()
        {
            _isDisposed = true;

            _formatConverter.Dispose();
            _wicFactory.Dispose();
            _dwriteFactory?.Dispose();
            _d2dFactory?.Dispose();
            _deviceContext?.Dispose();
            _d2dTargetBitmap?.Dispose();
            _d2dDevice?.Dispose();
            _swapChain?.Dispose();
            _d3dDevice?.Dispose();
        }
Esempio n. 7
0
        public void Dispose()
        {
            brush.Dispose();

            wrFactory.Dispose();
            target.Dispose();
            bb.Dispose();
            fac.Dispose();
            d2dDevice.Dispose();
            dxgiFactory2.Dispose();
            dxgiAdapter.Dispose();
            dxgiDevice2.Dispose();
            defDevice.Dispose();
            d3device.Dispose();
            swapChain.Dispose();
            d2dContext.Dispose();
        }
Esempio n. 8
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
             d2dContext.Dispose();
             dwFactory.Dispose();
             imagingFactory.Dispose();
             d2dDevice.Dispose();
             dxgiDevice.Dispose();
             d3dDevice.Dispose();
             defaultDevice.Dispose();
             textBrush.Dispose();
             textFormat.Dispose();
         }
         disposedValue = true;
     }
 }
Esempio n. 9
0
        /// <summary>
        /// Releases unmanaged and - optionally - managed resources.
        /// </summary>
        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                _hudTextFormat.Dispose();
                _hudYellow.Dispose();
                _hudWhite.Dispose();

                _fontCollection.Dispose();
                _fontLoader.Dispose();
                _dwFactory.Dispose();

                _texResMan.Dispose();
                _spriteResMan.Dispose();

                _swapChain.Dispose();
                _d2dTarget.Dispose();
                _d2dFactory.Dispose();
                _d3dContext.Dispose();
                _d2dContext.Dispose();
                _device.Dispose();
            }
        }