Skip to content

Instantly share code, notes, and snippets.

@barbulescualex
Last active April 7, 2019 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barbulescualex/666ae6959f2f00ed15e261c916ddbc49 to your computer and use it in GitHub Desktop.
Save barbulescualex/666ae6959f2f00ed15e261c916ddbc49 to your computer and use it in GitHub Desktop.
func draw(in view: MTKView) {
//Creating the commandBuffer for the queue
guard let commandBuffer = metalCommandQueue.makeCommandBuffer() else {return}
//Creating the interface for the pipeline
guard let renderDescriptor = view.currentRenderPassDescriptor else {return}
//Setting a "background color"
renderDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(0, 0, 1, 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment