diff --git a/src/ProjectNameGame.cs b/src/ProjectNameGame.cs index c947671..ce71d40 100644 --- a/src/ProjectNameGame.cs +++ b/src/ProjectNameGame.cs @@ -26,11 +26,14 @@ namespace ProjectName var commandBuffer = GraphicsDevice.AcquireCommandBuffer(); var swapchainTexture = commandBuffer.AcquireSwapchainTexture(MainWindow); - commandBuffer.BeginRenderPass( - new ColorAttachmentInfo(swapchainTexture, Color.CornflowerBlue) - ); + if (swapchainTexture != null) + { + commandBuffer.BeginRenderPass( + new ColorAttachmentInfo(swapchainTexture, Color.CornflowerBlue) + ); - commandBuffer.EndRenderPass(); + commandBuffer.EndRenderPass(); + } GraphicsDevice.Submit(commandBuffer); }