graphicsdriver/metal: Specify macOS version (#768)

This commit is contained in:
Hajime Hoshi 2019-01-02 00:08:46 +09:00
parent 61afdc8852
commit a0a17330ee
4 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,7 @@ import (
"github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/mtl"
)
// #cgo CFLAGS: -mmacosx-version-min=10.11
// #cgo LDFLAGS: -framework QuartzCore -framework Foundation -framework CoreGraphics
//
// #include "ca.h"

View File

@ -59,7 +59,9 @@ const char *MetalLayer_SetMaximumDrawableCount(void *metalLayer,
void MetalLayer_SetDisplaySyncEnabled(void *metalLayer,
BOOL displaySyncEnabled) {
((CAMetalLayer *)metalLayer).displaySyncEnabled = displaySyncEnabled;
if (@available(macOS 10.13, *)) {
((CAMetalLayer *)metalLayer).displaySyncEnabled = displaySyncEnabled;
}
}
void MetalLayer_SetDrawableSize(void *metalLayer, double width, double height) {

View File

@ -30,6 +30,7 @@ import (
"unsafe"
)
// #cgo CFLAGS: -mmacosx-version-min=10.11
// #cgo LDFLAGS: -framework Metal -framework Foundation
//
// #include <stdlib.h>

View File

@ -27,6 +27,8 @@ import (
"github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/ca"
)
// #cgo CFLAGS: -mmacosx-version-min=10.11
//
// #include "ns.h"
import "C"