Instance Method

newTexture(URL:options:completionHandler:)

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

Declaration

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

Parameters

URL

The URL of the file to load.

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 URLs

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

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

func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]?, error: NSErrorPointer) -> [MTLTexture]

Synchronously loads image data and creates new Metal textures from the specified list of URLs.

func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]?, completionHandler: MTKTextureLoader.ArrayCallback)

Asynchronously loads image data and creates new Metal textures from the specified list of URLs.