8. 2D Drawing

Begin at the beginning and go on till you come to the end; then stop.—Lewis Carroll

Although it’s primarily known as a 3D graphics framework, Metal can also render 2D images to the screen, along with GPGPU programming.

In Metal, adding dimensions increases complexity. Because rendering a 2D image is less complicated than rendering a 3D one, it’s a good place to start. This exercise familiarizes you with all the pieces you need to create a 2D image. Because this topic takes practice to master, this chapter focuses on the basics with no added complexity.

Metal Graphics Rendering Pipeline

Pulling a drawing out of thin air requires precision and processing. Each program must go through a series of steps (or rendering pipeline) during ...

Get Metal Programming Guide: Tutorial and Reference via Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.