In this first project, we will create a basic triangle and display it on the device.
Create a new Xcode project. Select Metal as the technology and Swift as the language for the project:
Select a location to save the project in. In the
GameViewController.swift file, we delete all the contents of the
viewDidLoad functions, so that we can start from the absolute basics.
As discussed in the overview, the first thing that we have to do is get the device that the application will work on. Add the following line:
//get device let device: MTLDevice = MTLCreateSystemDefaultDevice()
We create a new constant called
device of the