Instance Method

newTexture(URL:options:)

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

Declaration

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

Parameters

URL

The URL of the file to load.

options

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

error

A pointer to an NSError object if an error occurred, or nil if the texture was fully loaded and initialized.

Return Value

A fully loaded and initialized Metal texture, or nil if an error occurred.

See Also

Loading Textures from URLs

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

Asynchronously 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.