Instance Method

newTexture(data:options:completionHandler:)

Asynchronously creates a new Metal texture from an in-memory representation of the texture's data.

Declaration

func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback)

Parameters

data

The NSData object containing image data.

options

A dictionary describing any additional texture loading steps. See Texture Loading Options.

completionHandler

A block called when the texture has been loaded and fully initialized.

See Also

Loading Textures from In-Memory Data Representations

func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]?) -> MTLTexture

Synchronously creates a new Metal texture from an in-memory representation of the texture's data.