2. Setting up a Development Environment

2. Setting up a Development Environment

Building a Renderer with Metal

In this part of the series we will setup a development environment from scratch so that we’re ready to begin writing some code.

One of the reasons I chose to write this series using Metal is because of how straight forward it is to setup an environment. The tooling that comes with Metal is really good, and will allow us to see mistakes and debug any code we write easily. The Swift programming language is a readable language that anyone can pick up quickly. No matter what tech stack you come from, you should be able to learn some fundamental Swift.

The tools you’ll need going forward are a Mac and Xcode. Compared to some other stacks we could be using, this is incredibly lean and straight forward.

Create an Apple Developer account

This isn’t strictly necessary but you should do it. Having an account will allow you to run your programs on a physical device, and give you access to developer forums. It’s free and only takes a few minutes to do. If you already have an Apple ID you’re part way there already.

  1. Create an Apple ID on Apple’s account page . If you already have one skip this step.

1_TOIIHv9PeCWHIZahwxx0wg.png

  1. Once you have an Apple ID you can sign in to the Developer Portal. You may already be signed in after you created an account. You should see the following page.

1_uNQuqbFT4KDe7q1fCf7N0w.png

Download and Install Xcode

  1. This is the only software we’ll need to begin learning and coding our renderer. As of writing, the latest version is Xcode 13, and it can be downloaded from the Downloads tab of the developer portal, or from the Mac App Store.

  2. If you downloaded Xcode from the App Store you’re ready to go, otherwise you’ll need to run the installer that you downloaded from the developer portal. Either way you’ll end up with an executable in your Applications directory. Launch Xcode!

  3. You may be prompted to install some additional software, press yes and wait for it to complete. Once that’s done you’re all set!

1_DRcFK9_2GCqciQKkOD9-Xw.png

Additional steps

  1. You can sign into your Apple Developer Account from the Xcode -> preferences menu. If you do this Xcode will be able to do a bunch of things for you later if you try to run your applications on a device. I suggest to do this as it only takes a few moments.

1_tvZNe5EPBTKRdXKNZpPjyA.png

Finally

You’re now all set to write applications for Apple platforms. In the next post I’ll begin explaining the steps involved in modern rendering, and we’ll write some code!

Follow me on Twitter for future updates: @kemalenver