Ejemplo n.º 1
0
        /// <summary>
        /// Call this method when the app suspends. It provides a hint to the driver that the app
        /// is entering an idle state and that temporary buffers can be reclaimed for use by other apps.
        /// </summary>
        public void Trim()
        {
            _d3DContext.ClearState();

            using (var dxgiDevice = _d3DDevice.QueryInterface <SharpDX.DXGI.Device3>()) {
                dxgiDevice.Trim();
            }
        }
        /// <summary>
        /// Call this method when the app suspends. It provides a hint to the driver that the app
        /// is entering an idle state and that temporary buffers can be reclaimed for use by other apps.
        /// </summary>
        public void Trim()
        {
            if (null != d3dContext)
            {
                d3dContext.ClearState();
            }

            if (null != d3dDevice)
            {
                using (var dxgiDevice = d3dDevice.QueryInterface <SharpDX.DXGI.Device3>())
                {
                    dxgiDevice.Trim();
                }
            }
        }