mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
metal: restrict to macOS 10.15+ and iOS 13+.
This commit is contained in:
@@ -241,10 +241,17 @@ Graphics::Graphics()
|
|||||||
, defaultTextures()
|
, defaultTextures()
|
||||||
, families()
|
, families()
|
||||||
{ @autoreleasepool {
|
{ @autoreleasepool {
|
||||||
|
if (@available(macOS 10.15, iOS 13.0, *))
|
||||||
|
{
|
||||||
graphicsInstance = this;
|
graphicsInstance = this;
|
||||||
device = MTLCreateSystemDefaultDevice();
|
device = MTLCreateSystemDefaultDevice();
|
||||||
if (device == nil)
|
if (device == nil)
|
||||||
throw love::Exception("Metal is not supported on this system.");
|
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];
|
commandQueue = [device newCommandQueue];
|
||||||
passDesc = [MTLRenderPassDescriptor new];
|
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++)
|
for (NSInteger i = 0; i < 7; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user