Exemple #1
0
        /// <summary>
        /// Function to resize the back buffers.
        /// </summary>
        private void ResizeBuffers()
        {
            if (BeforeSwapChainResized != null)
            {
                BeforeSwapChainResized(this, EventArgs.Empty);
            }

            var targetReseat = _renderTarget.OnSwapChainResize();
            var depthReseat  = DepthStencilBuffer != null && DepthStencilBuffer.OnDepthStencilResize();

            GISwapChain.ResizeBuffers(Settings.BufferCount, Settings.VideoMode.Width, Settings.VideoMode.Height, (GI.Format)Settings.VideoMode.Format, GI.SwapChainFlags.AllowModeSwitch);
            CreateResources(targetReseat, depthReseat);

            if (AfterSwapChainResized != null)
            {
                AfterSwapChainResized(this, new GorgonAfterSwapChainResizedEventArgs(this));
            }
        }