File | File | |
| | @@ -55,10 +55,12 @@ func (l Layer) SetDevice(device Device) {
|
55 | 55 | // SetPixelFormat controls the pixel format of textures for rendering layer content.
|
56 | 56 | //
|
57 | 57 | // The pixel format for a Metal layer must be PixelFormatBGRA8UNorm, PixelFormatBGRA8UNormSRGB,
|
58 | 58 | // PixelFormatRGBA16Float, PixelFormatBGRA10XR, or PixelFormatBGRA10XRSRGB.
|
59 | 59 | // SetPixelFormat panics for other values.
|
| 60 | //
|
| 61 | // Reference: https://developer.apple.com/documentation/quartzcore/cametallayer/1478155-pixelformat.
|
60 | 62 | func (l Layer) SetPixelFormat(pf PixelFormat) {
|
61 | 63 | e := C.Layer_SetPixelFormat(l.layer, C.uint16_t(pf))
|
62 | 64 | if e != nil {
|
63 | 65 | panic(errors.New(C.GoString(e)))
|
64 | 66 | }
|
| | @@ -66,19 +68,23 @@ func (l Layer) SetPixelFormat(pf PixelFormat) {
|
66 | 68 |
|
67 | 69 | // SetMaximumDrawableCount controls the number of Metal drawables in the resource pool
|
68 | 70 | // managed by Core Animation.
|
69 | 71 | //
|
70 | 72 | // It can set to 2 or 3 only. SetMaximumDrawableCount panics for other values.
|
| 73 | //
|
| 74 | // Reference: https://developer.apple.com/documentation/quartzcore/cametallayer/2938720-maximumdrawablecount.
|
71 | 75 | func (l Layer) SetMaximumDrawableCount(count int) {
|
72 | 76 | e := C.Layer_SetMaximumDrawableCount(l.layer, C.uint_t(count))
|
73 | 77 | if e != nil {
|
74 | 78 | panic(errors.New(C.GoString(e)))
|
75 | 79 | }
|
76 | 80 | }
|
77 | 81 |
|
78 | 82 | // SetDisplaySyncEnabled controls whether the Metal layer and its drawables
|
79 | 83 | // are synchronized with the display's refresh rate.
|
| 84 | //
|
| 85 | // Reference: https://developer.apple.com/documentation/quartzcore/cametallayer/2887087-displaysyncenabled.
|
80 | 86 | func (l Layer) SetDisplaySyncEnabled(enabled bool) {
|
81 | 87 | switch enabled {
|
82 | 88 | case true:
|
83 | 89 | C.Layer_SetDisplaySyncEnabled(l.layer, 1)
|
84 | 90 | case false:
|