Instance Method

newTextureWithContentsOfURL:options:error:

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

Declaration

- (id<MTLTexture>)newTextureWithContentsOfURL:(NSURL *)URL options:(NSDictionary<MTKTextureLoaderOption, id> *)options error:(NSError * _Nullable *)error;

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

- newTextureWithContentsOfURL:options:completionHandler:

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

- newTexturesWithContentsOfURLs:options:error:

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

- newTexturesWithContentsOfURLs:options:completionHandler:

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