Instance Method

newTexture(cgImage:options:completionHandler:)

Asynchronously loads image data and creates a new Metal texture from a given bitmap image.

Declaration

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

Parameters

cgImage

The CGImage from which to load 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 Core Graphics Images

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

Synchronously loads image data and creates a new Metal texture from a given bitmap image.