コード例 #1
0
        private void DestroyImpl()
        {
            // Manually update back buffer texture
            backBuffer.OnDestroyed();
            backBuffer.LifetimeState = GraphicsResourceLifetimeState.Destroyed;

            swapChain.Dispose();
            swapChain = null;
        }
コード例 #2
0
        protected internal override void OnDestroyed()
        {
            // Manually update back buffer texture
            backBuffer.OnDestroyed();
            backBuffer.LifetimeState = GraphicsResourceLifetimeState.Destroyed;

            swapChain.Dispose();
            swapChain = null;

            base.OnDestroyed();
        }
コード例 #3
0
        protected override void ResizeBackBuffer(int width, int height, PixelFormat format)
        {
            graphicsDevice.OnDestroyed();

            startingPresentationParameters.BackBufferWidth  = width;
            startingPresentationParameters.BackBufferHeight = height;

            graphicsDevice.InitDefaultRenderTarget(startingPresentationParameters);

            var newTextureDescrition = backBuffer.Description;

            newTextureDescrition.Width  = width;
            newTextureDescrition.Height = height;

            // Manually update the texture
            backBuffer.OnDestroyed();

            // Put it in our back buffer texture
            backBuffer.InitializeFrom(newTextureDescrition);
        }
コード例 #4
0
        private unsafe void DestroySwapchain()
        {
            if (swapChain == Swapchain.Null)
            {
                return;
            }

            GraphicsDevice.NativeDevice.WaitIdle();

            backbuffer.OnDestroyed();

            foreach (var swapchainImage in swapchainImages)
            {
                GraphicsDevice.NativeDevice.DestroyImageView(swapchainImage.NativeColorAttachmentView);
            }
            swapchainImages = null;

            GraphicsDevice.NativeDevice.DestroySwapchain(swapChain);
            swapChain = Swapchain.Null;
        }