aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/exp/shiny/driver/mtldriver/internal/appkit/appkit.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/exp/shiny/driver/mtldriver/internal/appkit/appkit.go')
-rw-r--r--vendor/golang.org/x/exp/shiny/driver/mtldriver/internal/appkit/appkit.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/vendor/golang.org/x/exp/shiny/driver/mtldriver/internal/appkit/appkit.go b/vendor/golang.org/x/exp/shiny/driver/mtldriver/internal/appkit/appkit.go
index f6f6d5d..7140f6f 100644
--- a/vendor/golang.org/x/exp/shiny/driver/mtldriver/internal/appkit/appkit.go
+++ b/vendor/golang.org/x/exp/shiny/driver/mtldriver/internal/appkit/appkit.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin
// +build darwin
// Package appkit provides access to Apple's AppKit API
@@ -11,7 +12,7 @@
// It's a minimal implementation with scope limited to
// supporting mtldriver.
//
-// It was copied from dmitri.shuralyov.com/gpu/mtl/example/movingtriangle/internal/ns.
+// It was copied from dmitri.shuralyov.com/gpu/mtl/example/movingtriangle/internal/appkit.
package appkit
import (
@@ -21,6 +22,7 @@ import (
)
/*
+#include <stdbool.h>
#include "appkit.h"
*/
import "C"
@@ -63,12 +65,5 @@ func (v View) SetLayer(l coreanim.Layer) {
//
// Reference: https://developer.apple.com/documentation/appkit/nsview/1483695-wantslayer.
func (v View) SetWantsLayer(wantsLayer bool) {
- C.View_SetWantsLayer(v.view, toCBool(wantsLayer))
-}
-
-func toCBool(b bool) C.BOOL {
- if b {
- return 1
- }
- return 0
+ C.View_SetWantsLayer(v.view, C.bool(wantsLayer))
}