metalkit

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package metalkit provides purego-based Go bindings for the macOS MetalKit framework.

Apple documentation: https://developer.apple.com/documentation/metalkit

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MTKMeshNewMeshesFromAssetDeviceSourceMeshesError

func MTKMeshNewMeshesFromAssetDeviceSourceMeshesError(asset *modelio.MDLAsset, device metal.MTLDevice, sourceMeshes *foundation.NSArray[*modelio.MDLMesh]) (*foundation.NSArray[*MTKMesh], error)

@method newMeshesFromAsset:device:sourceMeshes:error: @abstract Initialize all meshes in a Model I/O asset. @param asset Model I/O asset from which to create MetalKit meshes @param device Metal device on which to create mesh resources @param sourceMeshes Array built by this method containing MDLMesh objects corresponding the returned MTKMesh objects @param error Pointer to an NSError object set if an error occurred @return MetalKit Meshes created from the Model I/O asset @discussion A convenience method to create MetalKit meshes from each mesh in a Model I/O asset. resulting meshes are returned while the corresponding Model I/O meshes from which they were generated will appear in the sourceMeshes array. All vertexBuffer objects in each MDLMesh object in the asset and the indexBuffer of each submesh within each of these meshes must have been created using a MTKMeshBufferAllocator object. Thus

func MTKMetalVertexDescriptorFromModelIO

func MTKMetalVertexDescriptorFromModelIO(modelIODescriptor *modelio.MDLVertexDescriptor) *metal.MTLVertexDescriptor

@function MTKMetalVertexDescriptorFromModelIO @abstract Partially converts a Model I/O vertex descriptor to a Metal vertex descriptor @discussion This method can only set vertex format, offset, bufferIndex, and stride information in the produced Metal vertex descriptor. It simply copies attributes 1 for 1. Thus attributes in the given Model I/O vertex descriptor must be arranged in the correct order for the resulting descriptor to properly map mesh data to vertex shader inputs. Layout stepFunction and stepRates for the resulting MTLVertexDescriptor must also be set by application.

func MTKMetalVertexDescriptorFromModelIOWithError

func MTKMetalVertexDescriptorFromModelIOWithError(modelIODescriptor *modelio.MDLVertexDescriptor, error_ unsafe.Pointer) *metal.MTLVertexDescriptor

@function MTKMetalVertexDescriptorFromModelIOWithError @abstract Partially converts a Model I/O vertex descriptor to a Metal vertex descriptor @discussion This method can only set vertex format, offset, bufferIndex, and stride information in the produced Metal vertex descriptor. It simply copies attributes 1 for 1. Thus attributes in the given Model I/O vertex descriptor must be arranged in the correct order for the resulting descriptor to properly map mesh data to vertex shader inputs. Layout stepFunction and stepRates for the resulting MTLVertexDescriptor must also be set by application. If error is nonnull, and the conversion cannot be made, it will be set.

func MTKMetalVertexFormatFromModelIO

func MTKMetalVertexFormatFromModelIO(vertexFormat modelio.MDLVertexFormat) metal.MTLVertexFormat

@function MTKMetalVertexFormatFromModelIO @abstract Converts a Model I/O vertex format to a Metal vertex format @return A Metal vertexformat correspoinding to the given Model I/O vertex format. Returns MTLVertexFormatInvalid if no matching Metal vertex format exists.

func MTKModelErrorDomain

func MTKModelErrorDomain() uintptr

@constant MTKModelErrorDomain

func MTKModelErrorKey

func MTKModelErrorKey() uintptr

@constant MTKModelErrorKey

func MTKModelIOVertexDescriptorFromMetal

func MTKModelIOVertexDescriptorFromMetal(metalDescriptor *metal.MTLVertexDescriptor) *modelio.MDLVertexDescriptor

@function MTKModelIOVertexDescriptorFromMetal @abstract Partially converts a Metal vertex descriptor to a Model I/O vertex descriptor @discussion This method can only set vertex format, offset, bufferIndex, and stride information in the produced Model I/O vertex descriptor. It does not add any semantic information such at attributes names. Names must be set in the returned Model I/O vertex descriptor before it can be applied to a a Model I/O mesh.

func MTKModelIOVertexDescriptorFromMetalWithError

func MTKModelIOVertexDescriptorFromMetalWithError(metalDescriptor *metal.MTLVertexDescriptor, error_ unsafe.Pointer) *modelio.MDLVertexDescriptor

@function MTKModelIOVertexDescriptorFromMetalWithError @abstract Partially converts a Metal vertex descriptor to a Model I/O vertex descriptor @discussion This method can only set vertex format, offset, bufferIndex, and stride information in the produced Model I/O vertex descriptor. It does not add any semantic information such at attributes names. Names must be set in the returned Model I/O vertex descriptor before it can be applied to a a Model I/O mesh. If error is nonnull, and the conversion cannot be made, it will be set.

func MTKModelIOVertexFormatFromMetal

func MTKModelIOVertexFormatFromMetal(vertexFormat metal.MTLVertexFormat) modelio.MDLVertexFormat

@function MTKModelIOVertexFormatFromMetal @abstract Converts a Metal vertex format to a Model I/O vertex format @return A Model I/O vertexformat correspoinding to the given Metal vertex format. Returns MDLVertexFormatInvalid if no matching Model I/O vertex format exists.

func MTKTextureLoaderCubeLayoutVertical

func MTKTextureLoaderCubeLayoutVertical() uintptr

@constant MTKTextureLoaderCubeLayoutVertical @abstract Identifier specifying that the texture loader will create a cube texture from six faces arranged vertically within a single 2D image @discussion A texture cube will be created from six faces arranged vertically within a single 2D image. The image height must be six times the image width, with faces arranged in the following order from top to bottom: +X, -X, +Y, -Y, +Z, -Z.

func MTKTextureLoaderErrorDomain

func MTKTextureLoaderErrorDomain() uintptr

@constant MTKTextureLoaderErrorDomain

func MTKTextureLoaderErrorKey

func MTKTextureLoaderErrorKey() uintptr

@constant MTKTextureLoaderErrorKey

func MTKTextureLoaderOptionAllocateMipmaps

func MTKTextureLoaderOptionAllocateMipmaps() uintptr

@constant MTKTextureLoaderOptionAllocateMipmaps @abstract Identifier to be used in an options NSDictionary with a boolean NSNumber specifying whether to allocate memory for mipmaps when creating the texture @discussion If the boolean value specified with this string is true, the resulting Metal texture will have been created with mipmaps whose contents are undefined. It is the responsibility of the caller to fill out the contents of the mipmap data unless MTLTextureLoaderOptionGenerateMipmaps is specified. If the file being loaded contains data for mipmaps (such as in a PVR or KTX file) this option does not need to be specified. In those cases the mipmap memory will be allocated and the image data loaded.

func MTKTextureLoaderOptionCubeLayout

func MTKTextureLoaderOptionCubeLayout() uintptr

@constant MTKTextureLoaderOptionCubeLayout @abstract Identifier to be used in an options NSDictionary with an MTKTextureLoaderCubeLayout NSString specifying whether to create a cubemap from a 2D image @discussion The NSString value specified with this string must be one option of MTKTextureLoaderCubeLayout. If this option is omitted, the texture loader will not create cubemaps from 2D textures. This option cannot be used with PVR files, KTX files, or MDLTextures, which support cube textures directly.

func MTKTextureLoaderOptionGenerateMipmaps

func MTKTextureLoaderOptionGenerateMipmaps() uintptr

@constant MTKTextureLoaderOptionGenerateMipmaps @abstract Identifier to be used in an options NSDictionary with a boolean NSNumber specifying whether to generate mipmaps when creating the texture @discussion If the boolean value specified with this string is true, the resulting Metal texture will be created with mipmaps. If the file being loaded contains data for mipmaps (such as in a PVR or KTX file), specifying this option will overwrite the existing mipmap data in the loaded texture. This option can only be used if the pixel format of the texture is color filterable and color renderable. This option implies MTKTextureLoaderOptionAllocateMipmaps. Specifying this option will cause the MTKTextureLoader to submit work to the GPU on behalf of the caller.

func MTKTextureLoaderOptionLoadAsArray

func MTKTextureLoaderOptionLoadAsArray() uintptr

@constant MTKTextureLoaderOptionLoadAsArray @abstract Identifier specifying that the texture should be loaded as an array texture when possible. @discussion Type is an NSNumber with a boolean value.

func MTKTextureLoaderOptionOrigin

func MTKTextureLoaderOptionOrigin() uintptr

@constant MTKTextureLoaderOptionOrigin @abstract Identifier to be used in an options NSDictionary with an MTKTextureLoaderOrigin NSString specifying whether to flip textures vertically @discussion The NSString value specified with this string must be one option of MTKTextureLoaderOrigin. If this option is omitted, the texture loader will not flip loaded textures. This option cannot be used with block-compressed texture formats, and can only be used with 2D, 2D array, and cube map textures. Each mipmap level and slice of a texture will be flipped.

func MTKTextureLoaderOptionSRGB

func MTKTextureLoaderOptionSRGB() uintptr

@constant MTKTextureLoaderOptionSRGB @abstract Identifier to be used in an options NSDictionary with a boolean NSNumber specifying whether to create the texture with an sRGB (gamma corrected) pixel format @discussion If the boolean value specified with this string is true, the texture will be created with an sRGB pixel format regardless of whether the image file specifies that the data has already been gamma corrected. Likewise, if false, the texture will be created with a non-sRGB pixel format regardless of whether the image file specifies that the data has been gamma corrected. To use the sRGB information specified in the file, do not specify this in the options dictionary. @warning When deploying to OS's prior to macOS 10.15 / iOS 13.0, this option is ignored for loading KTX textures.

func MTKTextureLoaderOptionTextureCPUCacheMode

func MTKTextureLoaderOptionTextureCPUCacheMode() uintptr

@constant MTKTextureLoaderOptionTextureCPUCacheMode @abstract Identifier to be used with an NSNumber specifying the MTLCPUCacheMode @discussion The resulting Metal texture will be created with the MTLCPUCacheMode indicated by the NSNumber associated with this string.

func MTKTextureLoaderOptionTextureStorageMode

func MTKTextureLoaderOptionTextureStorageMode() uintptr

@constant MTKTextureLoaderOptionTextureStorageMode @abstract Identifier to be used with an NSNumber specifying the MTLStorageMode @discussion The resulting Metal texture will be created with the MTLStorageMode indicated by the NSNumber associated with this string. If this option is omitted, the texture will be created with the default storage mode for Metal textures: MTLStorageModeShared on iOS, and MTLStorageModeManaged on OS X. Specifying this option with MTLTextureStorageModePrivate cause the MTKTextureLoader to submit work to the GPU on behalf of the caller.

func MTKTextureLoaderOptionTextureUsage

func MTKTextureLoaderOptionTextureUsage() uintptr

@constant MTKTextureLoaderOptionTextureUsage @abstract Identifier to be used with an NSNumber specifying the MTLTextureUsage flags @discussion The resulting Metal texture will be created with the MTLTextureUsage flags indicated by the NSNumber associated with this string.

func MTKTextureLoaderOriginBottomLeft

func MTKTextureLoaderOriginBottomLeft() uintptr

@constant MTKTextureLoaderOriginBottomLeft @abstract Identifier specifying that the texture loader should flip textures whose origin is in the top-left corner @discussion The texture will be flipped vertically if metadata in the file being loaded indicates that the source data starts with the top-left corner of the texture.

func MTKTextureLoaderOriginFlippedVertically

func MTKTextureLoaderOriginFlippedVertically() uintptr

@constant MTKTextureLoaderOriginFlippedVertically @abstract Identifier specifying that the texture loader should always flip textures @discussion The texture will be flipped vertically regardless of any metadata in the file indicating the placement of the origin in the source data

func MTKTextureLoaderOriginTopLeft

func MTKTextureLoaderOriginTopLeft() uintptr

@constant MTKTextureLoaderOriginTopLeft @abstract Identifier specifying that the texture loader should flip textures whose origin is in the bottom-left corner @discussion The texture will be flipped vertically if metadata in the file being loaded indicates that the source data starts with the bottom-left corner of the texture.

func SymbolAvailable

func SymbolAvailable(symbol string) bool

SymbolAvailable reports whether the named C symbol was bound when the library loaded. Calling a generated wrapper whose symbol is unavailable dereferences a nil function variable and panics.

Types

type Acl_entry_id_t

type Acl_entry_id_t int64
const (
	ACL_FIRST_ENTRY Acl_entry_id_t = 0
	ACL_NEXT_ENTRY  Acl_entry_id_t = -1
	ACL_LAST_ENTRY  Acl_entry_id_t = -2
)

func (Acl_entry_id_t) String

func (e Acl_entry_id_t) String() string

type Acl_flag_t

type Acl_flag_t int64
const (
	ACL_FLAG_DEFER_INHERIT      Acl_flag_t = 1
	ACL_FLAG_NO_INHERIT         Acl_flag_t = 131072
	ACL_ENTRY_INHERITED         Acl_flag_t = 16
	ACL_ENTRY_FILE_INHERIT      Acl_flag_t = 32
	ACL_ENTRY_DIRECTORY_INHERIT Acl_flag_t = 64
	ACL_ENTRY_LIMIT_INHERIT     Acl_flag_t = 128
	ACL_ENTRY_ONLY_INHERIT      Acl_flag_t = 256
)

func (Acl_flag_t) String

func (e Acl_flag_t) String() string

type Acl_perm_t

type Acl_perm_t int64
const (
	ACL_READ_DATA           Acl_perm_t = 2
	ACL_LIST_DIRECTORY      Acl_perm_t = 2
	ACL_WRITE_DATA          Acl_perm_t = 4
	ACL_ADD_FILE            Acl_perm_t = 4
	ACL_EXECUTE             Acl_perm_t = 8
	ACL_SEARCH              Acl_perm_t = 8
	ACL_DELETE              Acl_perm_t = 16
	ACL_APPEND_DATA         Acl_perm_t = 32
	ACL_ADD_SUBDIRECTORY    Acl_perm_t = 32
	ACL_DELETE_CHILD        Acl_perm_t = 64
	ACL_READ_ATTRIBUTES     Acl_perm_t = 128
	ACL_WRITE_ATTRIBUTES    Acl_perm_t = 256
	ACL_READ_EXTATTRIBUTES  Acl_perm_t = 512
	ACL_WRITE_EXTATTRIBUTES Acl_perm_t = 1024
	ACL_READ_SECURITY       Acl_perm_t = 2048
	ACL_WRITE_SECURITY      Acl_perm_t = 4096
	ACL_CHANGE_OWNER        Acl_perm_t = 8192
	ACL_SYNCHRONIZE         Acl_perm_t = 1048576
)

func (Acl_perm_t) String

func (e Acl_perm_t) String() string

type Acl_tag_t

type Acl_tag_t int64
const (
	ACL_UNDEFINED_TAG  Acl_tag_t = 0
	ACL_EXTENDED_ALLOW Acl_tag_t = 1
	ACL_EXTENDED_DENY  Acl_tag_t = 2
)

func (Acl_tag_t) String

func (e Acl_tag_t) String() string

type Acl_type_t

type Acl_type_t int64
const (
	ACL_TYPE_EXTENDED Acl_type_t = 256
	ACL_TYPE_ACCESS   Acl_type_t = 0
	ACL_TYPE_DEFAULT  Acl_type_t = 1
	ACL_TYPE_AFS      Acl_type_t = 2
	ACL_TYPE_CODA     Acl_type_t = 3
	ACL_TYPE_NTFS     Acl_type_t = 4
	ACL_TYPE_NWFS     Acl_type_t = 5
)

func (Acl_type_t) String

func (e Acl_type_t) String() string

type CGLCPContextPriorityRequest

type CGLCPContextPriorityRequest int64
const (
	KCGLCPContextPriorityRequestHigh   CGLCPContextPriorityRequest = 0
	KCGLCPContextPriorityRequestNormal CGLCPContextPriorityRequest = 1
	KCGLCPContextPriorityRequestLow    CGLCPContextPriorityRequest = 2
)

func (CGLCPContextPriorityRequest) String

type Clockid_t

type Clockid_t int64

func (Clockid_t) String

func (e Clockid_t) String() string

type Dispatch_autorelease_frequency_t

type Dispatch_autorelease_frequency_t uint64
const (
	DISPATCH_AUTORELEASE_FREQUENCY_INHERIT   Dispatch_autorelease_frequency_t = 0
	DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM Dispatch_autorelease_frequency_t = 1
	DISPATCH_AUTORELEASE_FREQUENCY_NEVER     Dispatch_autorelease_frequency_t = 2
)

func (Dispatch_autorelease_frequency_t) String

type Dispatch_block_flags_t

type Dispatch_block_flags_t uint64
const (
	DISPATCH_BLOCK_BARRIER           Dispatch_block_flags_t = 1
	DISPATCH_BLOCK_DETACHED          Dispatch_block_flags_t = 2
	DISPATCH_BLOCK_ASSIGN_CURRENT    Dispatch_block_flags_t = 4
	DISPATCH_BLOCK_NO_QOS_CLASS      Dispatch_block_flags_t = 8
	DISPATCH_BLOCK_INHERIT_QOS_CLASS Dispatch_block_flags_t = 16
	DISPATCH_BLOCK_ENFORCE_QOS_CLASS Dispatch_block_flags_t = 32
)

func (Dispatch_block_flags_t) String

func (e Dispatch_block_flags_t) String() string

type EvCmd

type EvCmd int64
const (
	EVNOP   EvCmd = 0
	EVHIDE  EvCmd = 1
	EVSHOW  EvCmd = 2
	EVMOVE  EvCmd = 3
	EVLEVEL EvCmd = 4
)

func (EvCmd) String

func (e EvCmd) String() string

type Filesec_property_t

type Filesec_property_t int64
const (
	FILESEC_OWNER         Filesec_property_t = 1
	FILESEC_GROUP         Filesec_property_t = 2
	FILESEC_UUID          Filesec_property_t = 3
	FILESEC_MODE          Filesec_property_t = 4
	FILESEC_ACL           Filesec_property_t = 5
	FILESEC_GRPUUID       Filesec_property_t = 6
	FILESEC_ACL_RAW       Filesec_property_t = 100
	FILESEC_ACL_ALLOCSIZE Filesec_property_t = 101
)

func (Filesec_property_t) String

func (e Filesec_property_t) String() string

type Idtype_t

type Idtype_t int64
const (
	P_ALL  Idtype_t = 0
	P_PID  Idtype_t = 1
	P_PGID Idtype_t = 2
)

func (Idtype_t) String

func (e Idtype_t) String() string

type Ipc_info_object_type_t

type Ipc_info_object_type_t int64
const (
	IPC_OTYPE_NONE                 Ipc_info_object_type_t = 0
	IPC_OTYPE_THREAD_CONTROL       Ipc_info_object_type_t = 1
	IPC_OTYPE_TASK_CONTROL         Ipc_info_object_type_t = 2
	IPC_OTYPE_HOST                 Ipc_info_object_type_t = 3
	IPC_OTYPE_HOST_PRIV            Ipc_info_object_type_t = 4
	IPC_OTYPE_PROCESSOR            Ipc_info_object_type_t = 5
	IPC_OTYPE_PROCESSOR_SET        Ipc_info_object_type_t = 6
	IPC_OTYPE_PROCESSOR_SET_NAME   Ipc_info_object_type_t = 7
	IPC_OTYPE_TIMER                Ipc_info_object_type_t = 8
	IPC_OTYPE_PORT_SUBST_ONCE      Ipc_info_object_type_t = 9
	IPC_OTYPE_MIG                  Ipc_info_object_type_t = 10
	IPC_OTYPE_MEMORY_OBJECT        Ipc_info_object_type_t = 11
	IPC_OTYPE_XMM_PAGER            Ipc_info_object_type_t = 12
	IPC_OTYPE_XMM_KERNEL           Ipc_info_object_type_t = 13
	IPC_OTYPE_XMM_REPLY            Ipc_info_object_type_t = 14
	IPC_OTYPE_UND_REPLY            Ipc_info_object_type_t = 15
	IPC_OTYPE_HOST_NOTIFY          Ipc_info_object_type_t = 16
	IPC_OTYPE_HOST_SECURITY        Ipc_info_object_type_t = 17
	IPC_OTYPE_LEDGER               Ipc_info_object_type_t = 18
	IPC_OTYPE_MAIN_DEVICE          Ipc_info_object_type_t = 19
	IPC_OTYPE_TASK_NAME            Ipc_info_object_type_t = 20
	IPC_OTYPE_SUBSYSTEM            Ipc_info_object_type_t = 21
	IPC_OTYPE_IO_DONE_QUEUE        Ipc_info_object_type_t = 22
	IPC_OTYPE_SEMAPHORE            Ipc_info_object_type_t = 23
	IPC_OTYPE_LOCK_SET             Ipc_info_object_type_t = 24
	IPC_OTYPE_CLOCK                Ipc_info_object_type_t = 25
	IPC_OTYPE_CLOCK_CTRL           Ipc_info_object_type_t = 26
	IPC_OTYPE_IOKIT_IDENT          Ipc_info_object_type_t = 27
	IPC_OTYPE_NAMED_ENTRY          Ipc_info_object_type_t = 28
	IPC_OTYPE_IOKIT_CONNECT        Ipc_info_object_type_t = 29
	IPC_OTYPE_IOKIT_OBJECT         Ipc_info_object_type_t = 30
	IPC_OTYPE_UPL                  Ipc_info_object_type_t = 31
	IPC_OTYPE_MEM_OBJ_CONTROL      Ipc_info_object_type_t = 32
	IPC_OTYPE_AU_SESSIONPORT       Ipc_info_object_type_t = 33
	IPC_OTYPE_FILEPORT             Ipc_info_object_type_t = 34
	IPC_OTYPE_LABELH               Ipc_info_object_type_t = 35
	IPC_OTYPE_TASK_RESUME          Ipc_info_object_type_t = 36
	IPC_OTYPE_VOUCHER              Ipc_info_object_type_t = 37
	IPC_OTYPE_VOUCHER_ATTR_CONTROL Ipc_info_object_type_t = 38
	IPC_OTYPE_WORK_INTERVAL        Ipc_info_object_type_t = 39
	IPC_OTYPE_UX_HANDLER           Ipc_info_object_type_t = 40
	IPC_OTYPE_UEXT_OBJECT          Ipc_info_object_type_t = 41
	IPC_OTYPE_ARCADE_REG           Ipc_info_object_type_t = 42
	IPC_OTYPE_EVENTLINK            Ipc_info_object_type_t = 43
	IPC_OTYPE_TASK_INSPECT         Ipc_info_object_type_t = 44
	IPC_OTYPE_TASK_READ            Ipc_info_object_type_t = 45
	IPC_OTYPE_THREAD_INSPECT       Ipc_info_object_type_t = 46
	IPC_OTYPE_THREAD_READ          Ipc_info_object_type_t = 47
	IPC_OTYPE_SUID_CRED            Ipc_info_object_type_t = 48
	IPC_OTYPE_HYPERVISOR           Ipc_info_object_type_t = 49
	IPC_OTYPE_TASK_ID_TOKEN        Ipc_info_object_type_t = 50
	IPC_OTYPE_TASK_FATAL           Ipc_info_object_type_t = 51
	IPC_OTYPE_KCDATA               Ipc_info_object_type_t = 52
	IPC_OTYPE_EXCLAVES_RESOURCE    Ipc_info_object_type_t = 53
	IPC_OTYPE_THREAD_RESUME        Ipc_info_object_type_t = 54
	IPC_OTYPE_UNKNOWN              Ipc_info_object_type_t = 4294967295
)

func (Ipc_info_object_type_t) String

func (e Ipc_info_object_type_t) String() string

type Launch_data_type_t

type Launch_data_type_t int64
const (
	LAUNCH_DATA_DICTIONARY Launch_data_type_t = 1
	LAUNCH_DATA_ARRAY      Launch_data_type_t = 2
	LAUNCH_DATA_FD         Launch_data_type_t = 3
	LAUNCH_DATA_INTEGER    Launch_data_type_t = 4
	LAUNCH_DATA_REAL       Launch_data_type_t = 5
	LAUNCH_DATA_BOOL       Launch_data_type_t = 6
	LAUNCH_DATA_STRING     Launch_data_type_t = 7
	LAUNCH_DATA_OPAQUE     Launch_data_type_t = 8
	LAUNCH_DATA_ERRNO      Launch_data_type_t = 9
	LAUNCH_DATA_MACHPORT   Launch_data_type_t = 10
)

func (Launch_data_type_t) String

func (e Launch_data_type_t) String() string

type MDLabelDomain

type MDLabelDomain int64

@typedef MDLabelDomain @abstract These constants are used to specify a domain to MDLabelCreate().

const (
	KMDLabelUserDomain  MDLabelDomain = 0
	KMDLabelLocalDomain MDLabelDomain = 1
)

func (MDLabelDomain) String

func (e MDLabelDomain) String() string

type MDQueryOptionFlags

type MDQueryOptionFlags int64
const (
	KMDQuerySynchronous        MDQueryOptionFlags = 1
	KMDQueryWantsUpdates       MDQueryOptionFlags = 4
	KMDQueryAllowFSTranslation MDQueryOptionFlags = 8
)

func (MDQueryOptionFlags) String

func (e MDQueryOptionFlags) String() string

type MDQuerySortOptionFlags

type MDQuerySortOptionFlags int64

@enum MDQuerySortOptionFlags @constant kMDQueryReverseSortOrderFlag Sort the attribute in reverse order.

const (
	KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)

func (MDQuerySortOptionFlags) String

func (e MDQuerySortOptionFlags) String() string

type MTKMesh

type MTKMesh struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/metalkit/mtkmesh

func MTKMeshFromID

func MTKMeshFromID(id objc.ID) *MTKMesh

func (*MTKMesh) InitWithMeshDeviceError

func (o *MTKMesh) InitWithMeshDeviceError(mesh *modelio.MDLMesh, device metal.MTLDevice) (*MTKMesh, error)

@method initWithMesh:device:error: @abstract Initialize the mesh and the mesh's submeshes. @param mesh Model I/O Mesh from which to create this MetalKit mesh @param device Metal device on which to create mesh resources @param error Pointer to an NSError object set if an error occurred @discussion The designated initializer for this class. This does NOT initialize any meshes that are children of the Model I/O mesh, only submeshes that are part of the given mesh. An exception is raised if vertexBuffer objects in the given mesh and the indexBuffer of any submesh in this mesh have not been created with a MTKMeshBufferAllocator object. If a submesh using MDLGeometryTypeQuads or MDLGeometryTypeTopology is used, that submesh will be copied, and recreated to use MDLGeometryTypeTriangles, before this routine creates the MTKSubmesh.

func (*MTKMesh) Name

func (o *MTKMesh) Name() *foundation.NSString

@property name @abstract Name of the mesh copies from the originating Model I/O mesh. @discussion Can be used by the app to identify the mesh in its scene/world/renderer etc.

func (*MTKMesh) SetName

func (o *MTKMesh) SetName(name *foundation.NSString)

func (*MTKMesh) Submeshes

func (o *MTKMesh) Submeshes() *foundation.NSArray[*MTKSubmesh]

@property submeshes @abstract Submeshes containing index buffers to rendering mesh vertices.

func (*MTKMesh) VertexBuffers

func (o *MTKMesh) VertexBuffers() *foundation.NSArray[*MTKMeshBuffer]

@property vertexBuffers @abstract Array of buffers in which mesh vertex data resides. @discussion This is filled with mesh buffer objects using the layout described by the vertexDescriptor property. Elements in this array can be [NSNull null] if the vertexDescriptor does not specify elements for buffer for the given index

func (*MTKMesh) VertexCount

func (o *MTKMesh) VertexCount() uint

@property vertexCount @abstract Number of vertices in the vertexBuffers.

func (*MTKMesh) VertexDescriptor

func (o *MTKMesh) VertexDescriptor() *modelio.MDLVertexDescriptor

@property vertexDescriptor @abstract Model I/O vertex descriptor specifying the layout of data in vertexBuffers. @discussion This is not directly used by this object, but the application can use this information to determine rendering state or create a Metal vertex descriptor to build a RenderPipelineState object capable of interpreting data in 'vertexBuffers'. Changing propties in the object will not result in the relayout data in vertex descriptor and thus will make the vertex descriptor no loger describe the layout of vertes data and verticies. (i.e. don't change properties in this vertexDescriptor)

type MTKMeshBuffer

type MTKMeshBuffer struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/metalkit/mtkmeshbuffer

func MTKMeshBufferFromID

func MTKMeshBufferFromID(id objc.ID) *MTKMeshBuffer

func (*MTKMeshBuffer) Allocator

func (o *MTKMeshBuffer) Allocator() *MTKMeshBufferAllocator

@property allocator @abstract Allocator object used to create this buffer. @discussion This allcoator is stored so that it can be used by Model I/O for copy and relayout operations (such as when a new vertex descriptor is applied to a vertex buffer).

func (*MTKMeshBuffer) Buffer

func (o *MTKMeshBuffer) Buffer() metal.MTLBuffer

@property buffer @abstract Metal Buffer backing vertex/index data. @discussion Many MTKMeshBuffers may reference the same buffer, but each with it's own offset. (i.e. Many MTKMeshBuffers may be suballocated from a single buffer)

func (*MTKMeshBuffer) Length

func (o *MTKMeshBuffer) Length() uint

@method length @abstract Size in bytes of the buffer allocation.

func (*MTKMeshBuffer) Offset

func (o *MTKMeshBuffer) Offset() uint

@property offset @abstract Byte offset of the data within the metal buffer.

func (*MTKMeshBuffer) Type

@property type @abstract the intended type of the buffer

func (*MTKMeshBuffer) Zone

@property zone @abstract Zone from which this buffer was created (if it was created from a zone). @discussion A single MetalBuffer is allocated for each zone. Each zone could have many MTKMeshBuffers, each with it's own offset. If a MTKMeshBufferAllocator is used, Model I/O will attempt to load all vertex and index data of a single mesh into a single zone. This allows the GPU to achieve a higher cache hit rate when drawing the mesh. So although there maybe many MTKMeshBuffers for a model they will be backed with the same contigous MetalBuffer.

type MTKMeshBufferAllocator

type MTKMeshBufferAllocator struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/metalkit/mtkmeshbufferallocator

func MTKMeshBufferAllocatorFromID

func MTKMeshBufferAllocatorFromID(id objc.ID) *MTKMeshBufferAllocator

func (*MTKMeshBufferAllocator) Device

func (*MTKMeshBufferAllocator) InitWithDevice

func (o *MTKMeshBufferAllocator) InitWithDevice(device metal.MTLDevice) *MTKMeshBufferAllocator

@method initWithDevice @abstract Initialize the allocator with a device to be used to create buffers. @discussion The designated initializer for this class.

type MTKSubmesh

type MTKSubmesh struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/metalkit/mtksubmesh

func MTKSubmeshFromID

func MTKSubmeshFromID(id objc.ID) *MTKSubmesh

func (*MTKSubmesh) IndexBuffer

func (o *MTKSubmesh) IndexBuffer() *MTKMeshBuffer

@property indexBuffer @abstract IndexBuffer (including indexCount) to render the object. @discussion The MTLBuffer to use for indexBuffer parameter in a [MTLRenderCommandEncoder drawIndexedPrimitives] call.

func (*MTKSubmesh) IndexCount

func (o *MTKSubmesh) IndexCount() uint

@property indexCount @abstract Number of indicies in indexBuffer. @discussion Value to use for indexCount parameter in a [MTLRenderCommandEncoder drawIndexedPrimitives] call.

func (*MTKSubmesh) IndexType

func (o *MTKSubmesh) IndexType() metal.MTLIndexType

@property indexType @abstract Metal index type of data in indexBuffer. @discussion Value to use for indexType parameter in a [MTLRenderCommandEncoder drawIndexedPrimitives] call.

func (*MTKSubmesh) Mesh

func (o *MTKSubmesh) Mesh() *MTKMesh

@property mesh @abstract Parent MTKMesh object containing vertex data of this object. @discussion The buffer of this parent mesh should be set in the encoder before a drawIndexedPrimitives call is made.

func (*MTKSubmesh) Name

func (o *MTKSubmesh) Name() *foundation.NSString

@property name @abstract Name from the original MDLSubmesh object. @discussion Although not directly used by this object, the application may use this to identify the submesh in the renderer/scene/world.

func (*MTKSubmesh) PrimitiveType

func (o *MTKSubmesh) PrimitiveType() metal.MTLPrimitiveType

@property primitiveType @abstract Metal primitive type with which to draw this object. @discussion Value to use for primitiveType parameter in a [MTLRenderCommandEncoder drawIndexedPrimitives] call.

func (*MTKSubmesh) SetName

func (o *MTKSubmesh) SetName(name *foundation.NSString)

type MTKTextureLoader

type MTKTextureLoader struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/metalkit/mtktextureloader

func MTKTextureLoaderFromID

func MTKTextureLoaderFromID(id objc.ID) *MTKTextureLoader

func (*MTKTextureLoader) Device

func (o *MTKTextureLoader) Device() metal.MTLDevice

@property device @abstract Metal device with which to create Metal textures

func (*MTKTextureLoader) InitWithDevice

func (o *MTKTextureLoader) InitWithDevice(device metal.MTLDevice) *MTKTextureLoader

@method initWithDevice: @abstract Initialize the loader @param device Metal device with which to create Metal textures

func (*MTKTextureLoader) NewTextureWithCGImageOptionsCompletionHandler

func (o *MTKTextureLoader) NewTextureWithCGImageOptionsCompletionHandler(cgImage unsafe.Pointer, options *foundation.NSDictionary[*foundation.NSString, objc.ID], completionHandler func(objc.ID, unsafe.Pointer))

@method newTextureWithCGImage:options:completionHandler: @abstract Asynchronously create a Metal texture and load image data from the given CGImageRef @param cgImage CGImageRef containing image data from which to create the texture @param options Dictonary of MTKTextureLoaderOptions @param completionHandler Block called when texture has been loaded and fully initialized

func (*MTKTextureLoader) NewTextureWithCGImageOptionsError

func (o *MTKTextureLoader) NewTextureWithCGImageOptionsError(cgImage unsafe.Pointer, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (metal.MTLTexture, error)

@method newTextureWithCGImage:options:error: @abstract Synchronously create a Metal texture and load image data from the given CGImageRef @return The Metal texture. nil if an error occured @param cgImage CGImageRef containing image data from which to create the texture @param options Dictonary of MTKTextureLoaderOptions @param error Pointer to an autoreleased NSError object which will be set if an error occurred

func (*MTKTextureLoader) NewTextureWithContentsOfURLOptionsCompletionHandler

func (o *MTKTextureLoader) NewTextureWithContentsOfURLOptionsCompletionHandler(uRL *foundation.NSURL, options *foundation.NSDictionary[*foundation.NSString, objc.ID], completionHandler func(objc.ID, unsafe.Pointer))

@method newTextureWithContentsOfURL:options:completionHandler: @abstract Asynchronously create a Metal texture and load image data from the file at URL @param URL Location of image file from which to create the texture @param options Dictonary of MTKTextureLoaderOptions @param completionHandler Block called when the texture has been loaded and fully initialized

func (*MTKTextureLoader) NewTextureWithContentsOfURLOptionsError

func (o *MTKTextureLoader) NewTextureWithContentsOfURLOptionsError(uRL *foundation.NSURL, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (metal.MTLTexture, error)

@method newTextureWithContentsOfURL:options:error: @abstract Synchronously create a Metal texture and load image data from the file at URL @return The Metal texture. nil if an error occured @param URL Location of image file from which to create the texture @param options Dictonary of MTKTextureLoaderOptions @param error Pointer to an autoreleased NSError object which will be set if an error occurred

func (*MTKTextureLoader) NewTextureWithDataOptionsCompletionHandler

func (o *MTKTextureLoader) NewTextureWithDataOptionsCompletionHandler(data *foundation.NSData, options *foundation.NSDictionary[*foundation.NSString, objc.ID], completionHandler func(objc.ID, unsafe.Pointer))

@method newTextureWithData:options:completionHandler: @abstract Asynchronously create a Metal texture and load image data from the NSData object provided @param data NSData object containing image file data from which to create the texture @param options Dictonary of MTKTextureLoaderOptions @param completionHandler Block called when texture has been loaded and fully initialized

func (*MTKTextureLoader) NewTextureWithDataOptionsError

func (o *MTKTextureLoader) NewTextureWithDataOptionsError(data *foundation.NSData, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (metal.MTLTexture, error)

@method newTextureWithData:options:error: @abstract Synchronously create a Metal texture and load image data from the NSData object provided @return The Metal texture. nil if an error occured @param data NSData object containing image file data from which to create the texture @param options Dictonary of MTKTextureLoaderOptions @param error Pointer to an autoreleased NSError object which will be set if an error occurred

func (*MTKTextureLoader) NewTextureWithMDLTextureOptionsCompletionHandler

func (o *MTKTextureLoader) NewTextureWithMDLTextureOptionsCompletionHandler(texture *modelio.MDLTexture, options *foundation.NSDictionary[*foundation.NSString, objc.ID], completionHandler func(objc.ID, unsafe.Pointer))

@method newTextureWithMDLTexture:options:completionHandler: @abstract Asynchronously create a Metal texture and load image data from the given MDLTexture @param texture MDLTexture containing image data from which to create the texture @param options Dictonary of MTKTextureLoaderOptions @param completionHandler Block called when texture has been loaded and fully initialized

func (*MTKTextureLoader) NewTextureWithMDLTextureOptionsError

func (o *MTKTextureLoader) NewTextureWithMDLTextureOptionsError(texture *modelio.MDLTexture, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (metal.MTLTexture, error)

@method newTextureWithMDLTexture:options:error: @abstract Synchronously create a Metal texture and load image data from the given MDLTexture @return The Metal texture. nil if an error occured @param texture MDLTexture containing image data from which to create the texture @param options Dictonary of MTKTextureLoaderOptions @param error Pointer to an autoreleased NSError object which will be set if an error occurred

func (*MTKTextureLoader) NewTextureWithNameScaleFactorBundleOptionsCompletionHandler

func (o *MTKTextureLoader) NewTextureWithNameScaleFactorBundleOptionsCompletionHandler(name *foundation.NSString, scaleFactor float64, bundle *foundation.NSBundle, options *foundation.NSDictionary[*foundation.NSString, objc.ID], completionHandler func(objc.ID, unsafe.Pointer))

@method newTextureWithName:scaleFactor:bundle:options:completionHandler: @abstract Asynchronously create a Metal texture and load image data from a given texture or image asset name @param name A texture or image asset name @param scaleFactor scale factor of the texture to retrieve from the asset catalog. Typically the value retrieved from -[UIView contentScale] or -[NSWindow backingScaleFactor]. @param bundle Resource bundle in which the asset is located. Main bundle used if nil. @param options Dictonary of MTKTextureLoaderOptions. The following options are ignormed when used to load a texture asset but can be used when creating a texture from an image asset: MTKTextureLoaderOptionGenerateMipmaps MTKTextureLoaderOptionSRGB MTKTextureLoaderOptionCubeFromVerticalTexture MTKTextureLoaderOptionOrigin @param completionHandler Block called when texture has been loaded and fully initialized @discussion Uses texture data from version of the texture from the texture set in the asset catalog which mathces the device's traits. This method attempts to load a texture asset with thw name iven. If a texture asset with the name given does not exist, it will attempt to create a texture from an image asset with the given name

func (*MTKTextureLoader) NewTextureWithNameScaleFactorBundleOptionsError

func (o *MTKTextureLoader) NewTextureWithNameScaleFactorBundleOptionsError(name *foundation.NSString, scaleFactor float64, bundle *foundation.NSBundle, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (metal.MTLTexture, error)

@method newTextursWithName:scaleFactor:bundle:options:error: @abstract Synchronously create a Metal texture with texture data from a given texture or image asset name @return The Metal texture. nil if an error occured @param names An array of texture asset names @param scaleFactor scale factor of the texture to retrieve from the asset catalog. Typically the value retrieved from -[UIView contentScale] or -[NSWindow backingScaleFactor]. @param bundle Resource bundle in which the asset is located. Main bundle used if nil. @param options Dictonary of MTKTextureLoaderOptions. The following options are ignormed when used to load a texture asset but can be used when creating a texture from an image asset MTKTextureLoaderOptionGenerateMipmaps MTKTextureLoaderOptionSRGB MTKTextureLoaderOptionCubeFromVerticalTexture MTKTextureLoaderOptionOrigins @discussion Uses texture data from version of the texture from the texture set in the asset catalog which mathces the device's traits. This method attempts to load a texture asset with the name given. If a texture asset with the name given does not exist, it will attempt to create a texture from an image asset with the given name.

func (*MTKTextureLoader) NewTextureWithNameScaleFactorDisplayGamutBundleOptionsCompletionHandler

func (o *MTKTextureLoader) NewTextureWithNameScaleFactorDisplayGamutBundleOptionsCompletionHandler(name *foundation.NSString, scaleFactor float64, displayGamut appkit.NSDisplayGamut, bundle *foundation.NSBundle, options *foundation.NSDictionary[*foundation.NSString, objc.ID], completionHandler func(objc.ID, unsafe.Pointer))

@method newTextureWithName:scaleFactor:displayGamut:bundle:options:completionHandler: @abstract Asynchronously create a Metal texture and load image data from a given texture or image asset name @param name A texture or image asset name @param scaleFactor Scale factor of the texture to retrieve from the asset catalog. Typically the value retrieved from -[NSWindow backingScaleFactor]. @param displayGamut Version of the texture based upon the "Gamut" trait in Xcode. You'd typically check -[NSWindow canRepresentDisplayGamut:] with the widest NSDisplayGamut value and pass that value here if it returns YES. @param bundle Resource bundle in which the asset is located. Main bundle used if nil. @param options Dictonary of MTKTextureLoaderOptions. The following options are ignormed when used to load a texture asset but can be used when creating a texture from an image asset: MTKTextureLoaderOptionGenerateMipmaps MTKTextureLoaderOptionSRGB MTKTextureLoaderOptionCubeFromVerticalTexture MTKTextureLoaderOptionOrigin @param completionHandler Block called when texture has been loaded and fully initialized @discussion Uses texture data from version of the texture from the texture set in the asset catalog which mathces the device's traits. This method attempts to load a texture asset with the name given. If a texture asset with the name given does not exist, it will attempt to create a texture from an image asset with the given name. This method can be used on macOS to choose between sRGB and P3 versions of a texture asset depending on the gamut of the display rendered to.

func (*MTKTextureLoader) NewTextureWithNameScaleFactorDisplayGamutBundleOptionsError

func (o *MTKTextureLoader) NewTextureWithNameScaleFactorDisplayGamutBundleOptionsError(name *foundation.NSString, scaleFactor float64, displayGamut appkit.NSDisplayGamut, bundle *foundation.NSBundle, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (metal.MTLTexture, error)

@method newTextursWithName:scaleFactor:displayGamut:bundle:options:error: @abstract Synchronously create a Metal texture with texture data from a given texture or image asset name @return The Metal texture. nil if an error occured @param names An array of texture asset names @param scaleFactor Scale factor of the texture to retrieve from the asset catalog. Typically the value retrieved from -[UIView contentScale] or -[NSWindow backingScaleFactor]. @param displayGamut Version of the texture based upon the "Gamut" trait in Xcode. You'd typically check -[NSWindow canRepresentDisplayGamut:] with the widest NSDisplayGamut value and pass that value here if it returns YES.@param bundle Resource bundle in which the assets are located @param bundle Resource bundle in which the asset is located. Main bundle used if nil. @param options Dictonary of MTKTextureLoaderOptions. The following options are ignormed when used to load a texture asset but can be used when creating a texture from an image asset MTKTextureLoaderOptionGenerateMipmaps MTKTextureLoaderOptionSRGB MTKTextureLoaderOptionCubeFromVerticalTexture MTKTextureLoaderOptionOrigin @discussion Uses texture data from version of the texture from the texture set in the asset catalog which mathces the device's traits. This method attempts to load a texture asset with the name given. If a texture asset with the name given does not exist, it will attempt to create a texture from an image asset with the given name. This method can be used on macOS to choose between sRGB and P3 versions of a texture asset depending on the gamut of the display rendered to.

func (*MTKTextureLoader) NewTexturesWithContentsOfURLsOptionsCompletionHandler

func (o *MTKTextureLoader) NewTexturesWithContentsOfURLsOptionsCompletionHandler(uRLs *foundation.NSArray[*foundation.NSURL], options *foundation.NSDictionary[*foundation.NSString, objc.ID], completionHandler objc.Block)

@method newTexturesWithContentsOfURLs:options:completionHandler: @abstract Asynchronously create an array of Metal textures and load image data from the files at URLs @param URLs Locations of image files from which to create the textures @param options Dictonary of MTKTextureLoaderOptions, which will be used for every texture loaded @param completionHandler Block called when all of the textures have been loaded and fully initialized. The array of MTLTextures will be the same length and in the same order as the requested array of paths. If an error occurs while loading a texture, the corresponding array index will contain NSNull. The NSError will be null if all of the textures are loaded successfully, or will correspond to one of the textures which failed to load.

func (*MTKTextureLoader) NewTexturesWithContentsOfURLsOptionsError

func (o *MTKTextureLoader) NewTexturesWithContentsOfURLsOptionsError(uRLs *foundation.NSArray[*foundation.NSURL], options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*foundation.NSArray[metal.MTLTexture], error)

@method newTexturesWithContentsOfURLs:options:completionHandler: @abstract Synchronously create an array of Metal textures and load image data from the files at URLs @return An array of MTLTextures of the same length and in the same order as the requested array of paths. If an error occurs while loading a texture, the corresponding array index will contain [NSNull null]. @param URLs Locations of image files from which to create the textures @param options Dictonary of MTKTextureLoaderOptions, which will be used for every texture loaded @param error Pointer to an autoreleased NSError object which will be set if an error occurred. Will be null if all of the textures are loaded successfully, or will correspond to one of the textures which failed to load.

func (*MTKTextureLoader) NewTexturesWithNamesScaleFactorBundleOptionsCompletionHandler

func (o *MTKTextureLoader) NewTexturesWithNamesScaleFactorBundleOptionsCompletionHandler(names *foundation.NSArray[*foundation.NSString], scaleFactor float64, bundle *foundation.NSBundle, options *foundation.NSDictionary[*foundation.NSString, objc.ID], completionHandler objc.Block)

@method newTexturesWithNames:scaleFactor:bundle:options:completionHandler: @abstract Asynchronously create Metal textures and load image data from a given texture or image asset names @param names An array texture or image asset names. If an error occurs while loading a texture, the corresponding index in the returned array contain [NSNull null] @param scaleFactor scale factor of the texture to retrieve from the asset catalog. Typically the value retrieved from -[UIView contentScale] or -[NSWindow backingScaleFactor]. @param bundle Resource bundle in which the assets are located. Main bundle used if nil. @param options Dictonary of MTKTextureLoaderOptions. The following options are ignormed when used to load a texture asset but can be used when creating a texture from an image asset MTKTextureLoaderOptionGenerateMipmaps MTKTextureLoaderOptionSRGB MTKTextureLoaderOptionCubeFromVerticalTexture MTKTextureLoaderOptionOrigin @param completionHandler Block called when all of the textures have been loaded and fully initialized. The NSError will be null if all of the textures are loaded successfully, or will correspond to one of the textures which failed to load. @discussion Uses texture data from version of the texture from the texture set in the asset catalog which mathces the device's traits. This method attempts to load a texture asset with each name iven. If a texture asset with the name given does not exist, it will attempt to create a texture from an image asset with the given name.

func (*MTKTextureLoader) NewTexturesWithNamesScaleFactorDisplayGamutBundleOptionsCompletionHandler

func (o *MTKTextureLoader) NewTexturesWithNamesScaleFactorDisplayGamutBundleOptionsCompletionHandler(names *foundation.NSArray[*foundation.NSString], scaleFactor float64, displayGamut appkit.NSDisplayGamut, bundle *foundation.NSBundle, options *foundation.NSDictionary[*foundation.NSString, objc.ID], completionHandler objc.Block)

@method newTexturesWithNames:scaleFactor:displayGamut:bundle:options:completionHandler: @abstract Asynchronously create Metal textures and load image data from given texture or image asset names @param names An array texture or image asset names. If an error occurs while loading a texture, the corresponding index in the returned array contain [NSNull null] @param scaleFactor Scale factor of the texture to retrieve from the asset catalog. Typically the value retrieved from -[UIView contentScale] or -[NSWindow backingScaleFactor] @param displayGamut Version of the texture based upon the "Gamut" trait in Xcode. You'd typically check -[NSWindow canRepresentDisplayGamut:] with the widest NSDisplayGamut value and pass that value here if it returns YES.@param bundle Resource bundle in which the assets are located @param options Dictonary of MTKTextureLoaderOptions. The following options are ignormed when used to load a texture asset but can be used when creating a texture from an image asset MTKTextureLoaderOptionGenerateMipmaps MTKTextureLoaderOptionSRGB MTKTextureLoaderOptionCubeFromVerticalTexture MTKTextureLoaderOptionOrigin @param completionHandler Block called when all of the textures have been loaded and fully initialized. The NSError will be nif if all of the textures are loaded successfully, or will correspond to one of the textures which failed to load. @discussion Uses texture data from version of the texture from the texture sets in the asset catalog which mathces the device's traits. This method attempts to load a texture asset with each name given. If a texture asset with the name given does not exist, it will attempt to create a texture from an image asset with the given name. This method can be used on macOS to choose between sRGB and P3 versions of a texture asset depending on the gamut of the display rendered to, If a texture with a name fails to load, the correposding index in the returned array will be set to [NSNull null]. An error will also be set. Thus, if there is a failure to load a texture with a name, other names may succesfully be loaded. Also, a set error does not necessarily mean all textures in the names array have failed to load.

type MTKView

type MTKView struct {
	appkit.NSView
}

Apple documentation: https://developer.apple.com/documentation/metalkit/mtkview

func MTKViewFromID

func MTKViewFromID(id objc.ID) *MTKView

func (*MTKView) AutoResizeDrawable

func (o *MTKView) AutoResizeDrawable() bool

@property autoResizeDrawable @abstract Controls whether to resize the drawable as the view changes size. @discussion If true, the size of the currentDrawable's texture, depthStencilTexture, and multisampleColorTexture will automatically resize as the view resizes. If false, these textures will take on the size of drawableSize and drawableSize will not change. The default value is true.

func (*MTKView) ClearColor

func (o *MTKView) ClearColor() metal.MTLClearColor

@property clearColor @abstract The clear color value used to generate the currentRenderPassDescriptor @discussion This defaults to (0.0, 0.0, 0.0, 1.0)

func (*MTKView) ClearDepth

func (o *MTKView) ClearDepth() float64

@property clearDepth @abstract The clear depth value used to generate the currentRenderPassDescriptor @discussion This defaults to 1.0

func (*MTKView) ClearStencil

func (o *MTKView) ClearStencil() uint32

@property clearStencil @abstract The clear stencil value used to generate currentRenderPassDescriptor @discussion This defaults to 0

func (*MTKView) ColorPixelFormat

func (o *MTKView) ColorPixelFormat() metal.MTLPixelFormat

@property colorPixelFormat @abstract The pixelFormat for the drawable's texture.

func (*MTKView) Colorspace

func (o *MTKView) Colorspace() unsafe.Pointer

@property colorspace @abstract The colorspace of the rendered frames. ' @discussion If nil, no colormatching occurs. If non-nil, the rendered content will be colormatched to the colorspace of the context containing this layer (typically the display's colorspace). This property aliases the olorspace property or the view's CAMetalLayer

func (*MTKView) CurrentDrawable

func (o *MTKView) CurrentDrawable() quartzcore.CAMetalDrawable

@property currentDrawable @abstract The drawable to be used for the current frame. @discussion currentDrawable is updated at the end -draw (i.e. after the delegate's drawInMTKView method is called)

func (*MTKView) CurrentMTL4RenderPassDescriptor

func (o *MTKView) CurrentMTL4RenderPassDescriptor() *metal.MTL4RenderPassDescriptor

@property currentMTL4RenderPassDescriptor @abstract A render pass descriptor generated from the currentDrawable's texture and the view's depth, stencil, and sample buffers and clear values. @discussion This is a convience property. The view does not use this descriptor and there is no requirement for an app to use this descriptor.

func (*MTKView) CurrentRenderPassDescriptor

func (o *MTKView) CurrentRenderPassDescriptor() *metal.MTLRenderPassDescriptor

@property currentRenderPassDescriptor @abstract A render pass descriptor generated from the currentDrawable's texture and the view's depth, stencil, and sample buffers and clear values. @discussion This is a convience property. The view does not use this descriptor and there is no requirement for an app to use this descriptor.

func (*MTKView) Delegate

func (o *MTKView) Delegate() MTKViewDelegate

@property delegate @abstract The delegate handling common view operations

func (*MTKView) DepthStencilAttachmentTextureUsage

func (o *MTKView) DepthStencilAttachmentTextureUsage() metal.MTLTextureUsage

@property depthStencilAttachmentTextureUsage @abstract The usage flags set on the depth attachment. @discussion This property controls the texture usage flags set on the MTKView's depth-stencil attachment on creation. This value defaults to MTLTextureUsageRenderTarget. The recommended value for most applications is MTLTextureUsageRenderTarget. Changing this value re-creates the depth attachment, but any data currently in the depth attachment will be lost.

func (*MTKView) DepthStencilPixelFormat

func (o *MTKView) DepthStencilPixelFormat() metal.MTLPixelFormat

@property depthStencilPixelFormat @abstract The pixelFormat used to create depthStencilTexture

func (*MTKView) DepthStencilStorageMode

func (o *MTKView) DepthStencilStorageMode() metal.MTLStorageMode

@property depthStencilStorageMode @abstract The storage mode for the depthStencilTexture. Defaults to MTLStorageModePrivate.

func (*MTKView) DepthStencilTexture

func (o *MTKView) DepthStencilTexture() metal.MTLTexture

@property depthStencilTexture @abstract A packed depth and stencil texture to be attached to a MTLRenderPassDescriptor @discussion The view will generate the depth buffer using the specified depthPixelFormat. This will be nil if depthStencilPixelFormat is MTLPixelFormatInvalid.

func (*MTKView) Device

func (o *MTKView) Device() metal.MTLDevice

@property device @abstract The MTLDevice used to create Metal objects @discussion This must be explicitly set by the application unless it was passed into the initializer. Defaults to nil

func (*MTKView) Draw

func (o *MTKView) Draw()

@method draw @abstract Manually ask the view to draw new contents. This causes the view to call either the drawInMTKView (delegate) or drawRect (subclass) method. @discussion Manually ask the view to draw new contents. This causes the view to call either the drawInMTKView (delegate) or drawRect (subclass) method. This should be used when the view's paused proprety is set to true and enableSetNeedsDisplay is set to false.

func (*MTKView) DrawableSize

func (o *MTKView) DrawableSize() corefoundation.CGSize

@property drawableSize @abstract The current size of drawable textures @discussion The size currentDrawable's texture, depthStencilTexture, and multisampleColorTexture. If autoResizeDrawable is true this value will be updated as the view's size changes. If autoResizeDrawable is false, this can be set to fix the size of the drawable textures.

func (*MTKView) EnableSetNeedsDisplay

func (o *MTKView) EnableSetNeedsDisplay() bool

@property enableSetNeedsDisplay @abstract Controls whether the view responds to setNeedsDisplay. @discussion If true, then the view behaves similarily to a UIView or NSView, responding to calls to setNeedsDisplay. When the view has been marked for display, the view is automatically redisplayed on each pass through the application’s event loop. Setting enableSetNeedsDisplay to true will also pause the MTKView's internal render loop and updates will instead be event driven. The default value is false.

func (*MTKView) FramebufferOnly

func (o *MTKView) FramebufferOnly() bool

@property framebufferOnly @abstract If the currentDrawable can be used for sampling or texture read operations @discussion This defaults to YES. This property controls whether or not the returned drawables' MTLTextures may only be used for framebuffer attachments (YES) or whether they may also be used for texture sampling and pixel read/write operations (NO). A value of YES allows the CAMetalLayer to allocate the MTLTexture objects in ways that are optimized for display purposes that makes them unsuitable for sampling. The recommended value for most applications is YES.

func (*MTKView) InitWithCoder

func (o *MTKView) InitWithCoder(coder *foundation.NSCoder) *MTKView

@method initWithCoder: @abstract Returns a view initalized from data in a given unarchiver @param coder An unarchiver object

func (*MTKView) InitWithFrameDevice

func (o *MTKView) InitWithFrameDevice(frameRect corefoundation.CGRect, device metal.MTLDevice) *MTKView

@method initWithFrame:device @abstract Initalize the view with a frame and device @param frameRect The frame rectangle for the created view object. @param device The MTLDevice to be used by the view to create Metal objects

func (*MTKView) IsPaused

func (o *MTKView) IsPaused() bool

@property paused @abstract Controls whether the draw methods should countinue at preferredFramesPerSecond @discussion If true, the delegate will receive drawInMTKView: messages or the subclass will receive drawRect: messages at a rate of preferredFramesPerSecond based on an internal timer. The default value is false.

func (*MTKView) MultisampleColorAttachmentTextureUsage

func (o *MTKView) MultisampleColorAttachmentTextureUsage() metal.MTLTextureUsage

@property multisampleColorAttachmentTextureUsage @abstract The texture usage flags for the multisample color attachment. @discussion This property controls the texture usage flags set on the the multisample color attachment attachment. This value defaults to MTLTextureUsageRenderTarget. The recommended value for most applications is MTLTextureUsageRenderTarget. Changing this value re-creates the multisample color attachment, but any data currently in the multisample color attachment will be lost.

func (*MTKView) MultisampleColorTexture

func (o *MTKView) MultisampleColorTexture() metal.MTLTexture

@property multisampleColorTexture @abstract A multisample color texture that will be resolved into the currentDrawable's texture @discussion The view will generate the multisample color buffer using the specified colorPixelFormat. This will be nil if sampleCount is less than or equal to 1.

func (*MTKView) PreferredDevice

func (o *MTKView) PreferredDevice() metal.MTLDevice

@property preferredDevice @abstract The preferred device is updated per-frame by the system in order to identify the most efficient GPU for presentation (e.g. the one being used for compositing). @discussion This value is determined by the underlying CAMetalLayer and this property is a convenience accessor for it.

func (*MTKView) PreferredDrawableSize

func (o *MTKView) PreferredDrawableSize() corefoundation.CGSize

@property preferredDrawableSize @abstract The preferred drawable size reported by the backing NSView to match a NSView's native resolution. @discussion this value can be observed via key-value observation to determine if the current native drawable size has changed.

func (*MTKView) PreferredFramesPerSecond

func (o *MTKView) PreferredFramesPerSecond() int

@property preferredFramesPerSecond @abstract The rate you want the view to redraw its contents. @discussion When your application sets its preferred frame rate, the view chooses a frame rate as close to that as possible based on the capabilities of the screen the view is displayed on. The actual frame rate chosen is usually a factor of the maximum refresh rate of the screen to provide a consistent frame rate. For example, if the maximum refresh rate of the screen is 60 frames per second, that is also the highest frame rate the view sets as the actual frame rate. However, if you ask for a lower frame rate, it might choose 30, 20, 15 or some other factor to be the actual frame rate. Your application should choose a frame rate that it can consistently maintain. The default value is 60 frames per second.

func (*MTKView) PresentsWithTransaction

func (o *MTKView) PresentsWithTransaction() bool

@property presentsWithTransaction @abstract If the layer should be presented synchronously @discussion Defaults to NO. When NO, changes to the layer's render buffer appear on-screen asynchronously to normal layer updates. When YES, changes to the MTL content are sent to the screen via the standard CATransaction mechanisms.

func (*MTKView) ReleaseDrawables

func (o *MTKView) ReleaseDrawables()

@method releaseDrawables @abstract Release the depthStencilTexture and multisampleColorTexture @discussion Can be called by the app to release the textures in order to conserve memory when it goes into the background. The view will recreate multisampleColorTexture or depthStencilTexture upon the next access of the respective properties. Both multisampleColorTexture and depthStencilTexture will be recreated in the access to currentRenderPassDescriptor.

func (*MTKView) ResidencySet

func (o *MTKView) ResidencySet() metal.MTLResidencySet

@property residencySet @abstract Get the view's residency set. @discussion Get the view's residency set. The residency set contains all MTLTextures created by the view. Applications should use this residency set and the residency set of the view's underlying CAMetalLayer to ensure all required MTLTextures are resident before use.

func (*MTKView) SampleCount

func (o *MTKView) SampleCount() uint

@property sampleCount @abstract The sample count used to to create multisampleColorTexture @discussion This defaults to 1. If sampleCount is greater than 1 a multisampled color texture will be created and the currentDrawable's texture will be set as the resolve texture in the currentRenderPassDescriptor and the store action will be set to MTLStoreActionMultisampleResolve

func (*MTKView) SetAutoResizeDrawable

func (o *MTKView) SetAutoResizeDrawable(autoResizeDrawable bool)

func (*MTKView) SetClearColor

func (o *MTKView) SetClearColor(clearColor metal.MTLClearColor)

func (*MTKView) SetClearDepth

func (o *MTKView) SetClearDepth(clearDepth float64)

func (*MTKView) SetClearStencil

func (o *MTKView) SetClearStencil(clearStencil uint32)

func (*MTKView) SetColorPixelFormat

func (o *MTKView) SetColorPixelFormat(colorPixelFormat metal.MTLPixelFormat)

func (*MTKView) SetColorspace

func (o *MTKView) SetColorspace(colorspace unsafe.Pointer)

func (*MTKView) SetDelegate

func (o *MTKView) SetDelegate(delegate MTKViewDelegate)

func (*MTKView) SetDepthStencilAttachmentTextureUsage

func (o *MTKView) SetDepthStencilAttachmentTextureUsage(depthStencilAttachmentTextureUsage metal.MTLTextureUsage)

func (*MTKView) SetDepthStencilPixelFormat

func (o *MTKView) SetDepthStencilPixelFormat(depthStencilPixelFormat metal.MTLPixelFormat)

func (*MTKView) SetDepthStencilStorageMode

func (o *MTKView) SetDepthStencilStorageMode(depthStencilStorageMode metal.MTLStorageMode)

func (*MTKView) SetDevice

func (o *MTKView) SetDevice(device metal.MTLDevice)

func (*MTKView) SetDrawableSize

func (o *MTKView) SetDrawableSize(drawableSize corefoundation.CGSize)

func (*MTKView) SetEnableSetNeedsDisplay

func (o *MTKView) SetEnableSetNeedsDisplay(enableSetNeedsDisplay bool)

func (*MTKView) SetFramebufferOnly

func (o *MTKView) SetFramebufferOnly(framebufferOnly bool)

func (*MTKView) SetMultisampleColorAttachmentTextureUsage

func (o *MTKView) SetMultisampleColorAttachmentTextureUsage(multisampleColorAttachmentTextureUsage metal.MTLTextureUsage)

func (*MTKView) SetPaused

func (o *MTKView) SetPaused(paused bool)

func (*MTKView) SetPreferredFramesPerSecond

func (o *MTKView) SetPreferredFramesPerSecond(preferredFramesPerSecond int)

func (*MTKView) SetPresentsWithTransaction

func (o *MTKView) SetPresentsWithTransaction(presentsWithTransaction bool)

func (*MTKView) SetSampleCount

func (o *MTKView) SetSampleCount(sampleCount uint)

type MTKViewDelegate

type MTKViewDelegate interface {
	MtkViewDrawableSizeWillChange(view *MTKView, size corefoundation.CGSize)
	DrawInMTKView(view *MTKView)
}

MTKViewDelegate wraps the ObjC protocol MTKViewDelegate.

type MTLDevice

type MTLDevice interface {
}

MTLDevice wraps the ObjC protocol MTLDevice.

type MTLTexture

type MTLTexture interface {
	metal.MTLResource
}

MTLTexture wraps the ObjC protocol MTLTexture.

type Mach_vm_range_flags_t

type Mach_vm_range_flags_t int64
const (
	MACH_VM_RANGE_NONE Mach_vm_range_flags_t = 0
)

func (Mach_vm_range_flags_t) String

func (e Mach_vm_range_flags_t) String() string

type Mach_vm_range_flavor_t

type Mach_vm_range_flavor_t int64
const (
	MACH_VM_RANGE_FLAVOR_INVALID Mach_vm_range_flavor_t = 0
	MACH_VM_RANGE_FLAVOR_V1      Mach_vm_range_flavor_t = 1
)

func (Mach_vm_range_flavor_t) String

func (e Mach_vm_range_flavor_t) String() string

type Mach_vm_range_tag_t

type Mach_vm_range_tag_t int64
const (
	MACH_VM_RANGE_DEFAULT Mach_vm_range_tag_t = 0
	MACH_VM_RANGE_DATA    Mach_vm_range_tag_t = 1
	MACH_VM_RANGE_FIXED   Mach_vm_range_tag_t = 2
)

func (Mach_vm_range_tag_t) String

func (e Mach_vm_range_tag_t) String() string

type Mpo_flags_t

type Mpo_flags_t int64
const (
	MPO_PORT                            Mpo_flags_t = 0
	MPO_SERVICE_PORT                    Mpo_flags_t = 1024
	MPO_CONNECTION_PORT                 Mpo_flags_t = 2048
	MPO_REPLY_PORT                      Mpo_flags_t = 4096
	MPO_WEAK_REPLY_PORT                 Mpo_flags_t = 16384
	MPO_NOTIFICATION_PORT               Mpo_flags_t = 17408
	MPO_EXCEPTION_PORT                  Mpo_flags_t = 32768
	MPO_CONNECTION_PORT_WITH_PORT_ARRAY Mpo_flags_t = 65536
)

func (Mpo_flags_t) String

func (e Mpo_flags_t) String() string

type NXMouseButton

type NXMouseButton int64
const (
	NX_OneButton   NXMouseButton = 0
	NX_LeftButton  NXMouseButton = 1
	NX_RightButton NXMouseButton = 2
)

func (NXMouseButton) String

func (e NXMouseButton) String() string

type Os_clockid_t

type Os_clockid_t int64
const (
	OS_CLOCK_MACH_ABSOLUTE_TIME Os_clockid_t = 32
)

func (Os_clockid_t) String

func (e Os_clockid_t) String() string

type Os_unfair_lock_flags_t

type Os_unfair_lock_flags_t int64
const (
	OS_UNFAIR_LOCK_FLAG_NONE          Os_unfair_lock_flags_t = 0
	OS_UNFAIR_LOCK_FLAG_ADAPTIVE_SPIN Os_unfair_lock_flags_t = 262144
)

func (Os_unfair_lock_flags_t) String

func (e Os_unfair_lock_flags_t) String() string

type PMPageToPaperMappingType

type PMPageToPaperMappingType int64
const (
	KPMPageToPaperMappingNone       PMPageToPaperMappingType = 1
	KPMPageToPaperMappingScaleToFit PMPageToPaperMappingType = 2
)

func (PMPageToPaperMappingType) String

func (e PMPageToPaperMappingType) String() string

type Ptrauth_key

type Ptrauth_key int64
const (
	Ptrauth_key_none                     Ptrauth_key = -1
	Ptrauth_key_asia                     Ptrauth_key = 0
	Ptrauth_key_asib                     Ptrauth_key = 1
	Ptrauth_key_asda                     Ptrauth_key = 2
	Ptrauth_key_asdb                     Ptrauth_key = 3
	Ptrauth_key_process_independent_code Ptrauth_key = 0
	Ptrauth_key_process_dependent_code   Ptrauth_key = 1
	Ptrauth_key_process_independent_data Ptrauth_key = 2
	Ptrauth_key_process_dependent_data   Ptrauth_key = 3
	Ptrauth_key_return_address           Ptrauth_key = 1
	Ptrauth_key_frame_pointer            Ptrauth_key = 3
	Ptrauth_key_function_pointer         Ptrauth_key = 0
	Ptrauth_key_block_function           Ptrauth_key = 0
	Ptrauth_key_cxx_vtable_pointer       Ptrauth_key = 2
	Ptrauth_key_method_list_pointer      Ptrauth_key = 2
	Ptrauth_key_objc_isa_pointer         Ptrauth_key = 2
	Ptrauth_key_objc_super_pointer       Ptrauth_key = 2
	Ptrauth_key_objc_sel_pointer         Ptrauth_key = 3
	Ptrauth_key_objc_class_ro_pointer    Ptrauth_key = 2
	Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2
	Ptrauth_key_init_fini_pointer        Ptrauth_key = 0
)

func (Ptrauth_key) String

func (e Ptrauth_key) String() string

type Qos_class_t

type Qos_class_t uint32
const (
	QOS_CLASS_USER_INTERACTIVE Qos_class_t = 33
	QOS_CLASS_USER_INITIATED   Qos_class_t = 25
	QOS_CLASS_DEFAULT          Qos_class_t = 21
	QOS_CLASS_UTILITY          Qos_class_t = 17
	QOS_CLASS_BACKGROUND       Qos_class_t = 9
	QOS_CLASS_UNSPECIFIED      Qos_class_t = 0
)

func (Qos_class_t) String

func (e Qos_class_t) String() string

type Virtual_memory_guard_exception_code_t

type Virtual_memory_guard_exception_code_t int64
const (
	KGUARD_EXC_DEALLOC_GAP                   Virtual_memory_guard_exception_code_t = 1
	KGUARD_EXC_RECLAIM_COPYIO_FAILURE        Virtual_memory_guard_exception_code_t = 2
	KGUARD_EXC_RECLAIM_INDEX_FAILURE         Virtual_memory_guard_exception_code_t = 4
	KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE    Virtual_memory_guard_exception_code_t = 8
	KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE    Virtual_memory_guard_exception_code_t = 9
	KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE         Virtual_memory_guard_exception_code_t = 10
	KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE         Virtual_memory_guard_exception_code_t = 11
	KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION  Virtual_memory_guard_exception_code_t = 12
	KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY    Virtual_memory_guard_exception_code_t = 13
	KGUARD_EXC_SEC_ACCESS_FAULT              Virtual_memory_guard_exception_code_t = 98
	KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT        Virtual_memory_guard_exception_code_t = 99
	KGUARD_EXC_SEC_COPY_DENIED               Virtual_memory_guard_exception_code_t = 100
	KGUARD_EXC_SEC_SHARING_DENIED            Virtual_memory_guard_exception_code_t = 101
	KGUARD_EXC_MTE_SYNC_FAULT                Virtual_memory_guard_exception_code_t = 200
	KGUARD_EXC_MTE_ASYNC_USER_FAULT          Virtual_memory_guard_exception_code_t = 201
	KGUARD_EXC_MTE_ASYNC_KERN_FAULT          Virtual_memory_guard_exception_code_t = 202
	KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 203
	KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 204
)

func (Virtual_memory_guard_exception_code_t) String

type Xpc_listener_create_flags_t

type Xpc_listener_create_flags_t int64
const (
	XPC_LISTENER_CREATE_NONE             Xpc_listener_create_flags_t = 0
	XPC_LISTENER_CREATE_INACTIVE         Xpc_listener_create_flags_t = 1
	XPC_LISTENER_CREATE_FORCE_MACH       Xpc_listener_create_flags_t = 2
	XPC_LISTENER_CREATE_FORCE_XPCSERVICE Xpc_listener_create_flags_t = 4
)

func (Xpc_listener_create_flags_t) String

type Xpc_session_create_flags_t

type Xpc_session_create_flags_t int64
const (
	XPC_SESSION_CREATE_NONE            Xpc_session_create_flags_t = 0
	XPC_SESSION_CREATE_INACTIVE        Xpc_session_create_flags_t = 1
	XPC_SESSION_CREATE_MACH_PRIVILEGED Xpc_session_create_flags_t = 2
)

func (Xpc_session_create_flags_t) String

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL