Commit 2a3c46a829b9 added support for supportsFamily, an API new to macOS 10.15. It used an @available check to avoid trying to call it on macOS 10.13 and 10.14, but despite not running, it still creates a warning like: mtl.m:44:33: warning: instance method '-supportsFamily:' not found (return type defaults to 'id') [-Wobjc-method-access] On those old macOS versions. Use an #ifdef directive until I find a better to handle this, or drop this complexity by raising the minimum supported macOS version. Tested on macOS 10.13.6 and 13.0.1.
The upstream Metal API has deprecated this part of its API. Explicitly ignore a compilation warning about the deprecation.
These were needed for a Metal API-based driver for x/exp/shiny.
Decide on and document the minimum supported macOS version as 10.13. macOS 10.13 runs on the same hardware as 10.12, so anyone with 10.12 can update to 10.13 and use this package. I don't have access to older versions of macOS to test with, nor do I have the bandwidth to support them.
The goal of this change is to make it possible to use package mtl to render to a window at interactive framerates (e.g., at 60 FPS, assuming a 60 Hz display with vsync on). It adds the minimal API that is needed. A new movingtriangle example is added as a demonstration of this functionality. It opens a window and renders a triangle that follows the mouse cursor. Much of the needed API comes from Core Animation, AppKit frameworks, rather than Metal. Avoid adding that to mtl package; instead create separate packages. For now, they are hidden in internal to avoid committing to a public API and import path. After gaining more confidence in the approach, they can be factored out and made public.