swapchainTexture null check

main
cosmonaut 2023-12-21 13:09:33 -08:00
parent dbaadccd47
commit 88e6d48d50
1 changed files with 7 additions and 4 deletions

View File

@ -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);
}