From 2868ede1914895ecffac7b8ba388ed7ff2385fed Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 24 Dec 2021 19:22:10 -0400 Subject: [PATCH] metal: restrict to macOS 10.15+ and iOS 13+. --- src/modules/graphics/metal/Graphics.mm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/modules/graphics/metal/Graphics.mm b/src/modules/graphics/metal/Graphics.mm index 6df0d595d..155918d77 100644 --- a/src/modules/graphics/metal/Graphics.mm +++ b/src/modules/graphics/metal/Graphics.mm @@ -241,10 +241,17 @@ Graphics::Graphics() , defaultTextures() , families() { @autoreleasepool { - graphicsInstance = this; - device = MTLCreateSystemDefaultDevice(); - if (device == nil) - throw love::Exception("Metal is not supported on this system."); + if (@available(macOS 10.15, iOS 13.0, *)) + { + graphicsInstance = this; + device = MTLCreateSystemDefaultDevice(); + if (device == nil) + throw love::Exception("Metal is not supported on this system."); + } + else + { + throw love::Exception("LOVE's Metal graphics backend requires macOS 10.15+ or iOS 13+."); + } commandQueue = [device newCommandQueue]; passDesc = [MTLRenderPassDescriptor new]; @@ -1908,7 +1915,7 @@ void Graphics::initCapabilities() } } - if (@available(macOS 10.15, iOS 13, *)) + if (@available(macOS 10.15, iOS 13.0, *)) { for (NSInteger i = 0; i < 7; i++) {