Пример #1
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;
        }
Пример #2
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();
 }
Пример #3
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();
 }
Пример #4
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();
            }
        }