Instance Method

newTexturesWithContentsOfURLs:options:error:

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

Declaration

- (NSArray<id<MTLTexture>> *)newTexturesWithContentsOfURLs:(NSArray<NSURL *> *)URLs options:(NSDictionary<MTKTextureLoaderOption, id> *)options error:(NSError * _Nullable *)error;

Parameters

URLs

An array of URLs referencing files to load.

options

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

error

If all textures were fully loaded and initialized, this pointer is nil on output. If an error occurs while loading any of the specified URLs, this pointer refers to an NSError object describing the failure. (Which element in the URLs array the error corresponds to is undefined.)

Return Value

An array of Metal textures, each corresponding to a URL listed in the URLs parameter. If an error occurs while loading a texture, the corresponding array element is an NSNull object.

See Also

Loading Textures from URLs

- newTextureWithContentsOfURL:options:error:

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

- newTextureWithContentsOfURL:options:completionHandler:

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

- newTexturesWithContentsOfURLs:options:completionHandler:

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