private void DestroyImpl() { // Manually update back buffer texture backBuffer.OnDestroyed(); backBuffer.LifetimeState = GraphicsResourceLifetimeState.Destroyed; swapChain.Dispose(); swapChain = null; }
protected internal override void OnDestroyed() { // Manually update back buffer texture backBuffer.OnDestroyed(); backBuffer.LifetimeState = GraphicsResourceLifetimeState.Destroyed; swapChain.Dispose(); swapChain = null; base.OnDestroyed(); }
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); }
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; }