mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
graphicsdriver/metal: Use selector again to access properties (#767)
This commit is contained in:
parent
6350cb6bfd
commit
ac6ad717b7
@ -48,11 +48,8 @@ const char *MetalLayer_SetMaximumDrawableCount(void *metalLayer,
|
||||
uint_t maximumDrawableCount) {
|
||||
if (@available(macOS 10.13.2, *)) {
|
||||
@try {
|
||||
if ([(CAMetalLayer *)metalLayer
|
||||
respondsToSelector:@selector(maximumDrawableCount)]) {
|
||||
((CAMetalLayer *)metalLayer).maximumDrawableCount =
|
||||
(NSUInteger)maximumDrawableCount;
|
||||
}
|
||||
[((CAMetalLayer *)metalLayer)
|
||||
setMaximumDrawableCount:(NSUInteger)maximumDrawableCount];
|
||||
} @catch (NSException *exception) {
|
||||
return exception.reason.UTF8String;
|
||||
}
|
||||
@ -63,10 +60,7 @@ const char *MetalLayer_SetMaximumDrawableCount(void *metalLayer,
|
||||
void MetalLayer_SetDisplaySyncEnabled(void *metalLayer,
|
||||
BOOL displaySyncEnabled) {
|
||||
if (@available(macOS 10.13, *)) {
|
||||
if ([(CAMetalLayer *)metalLayer
|
||||
respondsToSelector:@selector(displaySyncEnabled)]) {
|
||||
((CAMetalLayer *)metalLayer).displaySyncEnabled = displaySyncEnabled;
|
||||
}
|
||||
[((CAMetalLayer *)metalLayer) setDisplaySyncEnabled:displaySyncEnabled];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user