Metal Tutorial: Getting Started | raywenderlich.com

In this Metal tutorial, you will learn how to get started with Apple’s 3D graphics API by rendering a simple triangle to the screen.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/7475-metal-tutorial-getting-started

Thanks for this, I liked it.

I spent 10 minutes trying to transpose that into a Mac project and failed because the CADisplayLink class doesn’t exist on Mac. There is a CVDisplayLink class, but its API is different (no add for example), and I stopped there for the moment.

Having a Mac version would be nice if only because you would not need a physical device to do the tutorial.

So what would be the shortest path from here to a Mac version?

Thanks,

Jean-Denis

@haawa Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hi, thanks for the feedback!
On iOS I used CADisplayLink to keep things simpler.
You can use MTKView and MTKViewDelegate to get callback on when to draw, for both iOS and macOS.

You can check my repo on how I used it on macOS Metal-Mandelbrot-Fractal/MandelbrotViewController.swift at master · haawa799/Metal-Mandelbrot-Fractal · GitHub.

Hi there, thanks for tutorial! I’m finding that the triangle edges are not smooth but pixelated. Given that I was using an iPhoneX I was surprised to see them. Is there any way that I can make this triangle without the pixelation and with smooth diagonal sides of the triangle?

@haawa Can you please help with this when you get a chance? Thank you - much appreciated! :]

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!