mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +01:00
graphicsdriver/metal/ca: Suppress warnings (#767)
This commit is contained in:
parent
ac6ad717b7
commit
623bfde007
@ -48,8 +48,11 @@ const char *MetalLayer_SetMaximumDrawableCount(void *metalLayer,
|
|||||||
uint_t maximumDrawableCount) {
|
uint_t maximumDrawableCount) {
|
||||||
if (@available(macOS 10.13.2, *)) {
|
if (@available(macOS 10.13.2, *)) {
|
||||||
@try {
|
@try {
|
||||||
|
if ([(CAMetalLayer *)metalLayer
|
||||||
|
respondsToSelector:@selector(setMaximumDrawableCount:)]) {
|
||||||
[((CAMetalLayer *)metalLayer)
|
[((CAMetalLayer *)metalLayer)
|
||||||
setMaximumDrawableCount:(NSUInteger)maximumDrawableCount];
|
setMaximumDrawableCount:(NSUInteger)maximumDrawableCount];
|
||||||
|
}
|
||||||
} @catch (NSException *exception) {
|
} @catch (NSException *exception) {
|
||||||
return exception.reason.UTF8String;
|
return exception.reason.UTF8String;
|
||||||
}
|
}
|
||||||
@ -60,8 +63,11 @@ const char *MetalLayer_SetMaximumDrawableCount(void *metalLayer,
|
|||||||
void MetalLayer_SetDisplaySyncEnabled(void *metalLayer,
|
void MetalLayer_SetDisplaySyncEnabled(void *metalLayer,
|
||||||
BOOL displaySyncEnabled) {
|
BOOL displaySyncEnabled) {
|
||||||
if (@available(macOS 10.13, *)) {
|
if (@available(macOS 10.13, *)) {
|
||||||
|
if ([(CAMetalLayer *)metalLayer
|
||||||
|
respondsToSelector:@selector(setDisplaySyncEnabled:)]) {
|
||||||
[((CAMetalLayer *)metalLayer) setDisplaySyncEnabled:displaySyncEnabled];
|
[((CAMetalLayer *)metalLayer) setDisplaySyncEnabled:displaySyncEnabled];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetalLayer_SetDrawableSize(void *metalLayer, double width, double height) {
|
void MetalLayer_SetDrawableSize(void *metalLayer, double width, double height) {
|
||||||
|
Loading…
Reference in New Issue
Block a user