-
-
Save rmirabelli/2fe2642a39b8462e112dfbc5400f6f28 to your computer and use it in GitHub Desktop.
Prepare for rendering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// STEP 4: prepare our command buffer and drawable | |
let commandQueue = device?.makeCommandQueue() | |
let buffer = commandQueue?.makeCommandBuffer() | |
let drawable = metalLayer.nextDrawable() | |
// create the render pass descriptor | |
let rpDesc = MTLRenderPassDescriptor() | |
rpDesc.colorAttachments[0].texture = drawable?.texture | |
rpDesc.colorAttachments[0].loadAction = .clear | |
rpDesc.colorAttachments[0].clearColor = MTLClearColorMake(1.0, 0.0, 0.0, 1.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment