Contents

texture(withContentsOf:options:)

Loads a 2D texture image from a URL and creates a new texture from the data.

Declaration

class func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil) throws -> GLKTextureInfo

Parameters

  • url:

    A URL to the file to load.

  • options:

    A dictionary that describes any additional steps you want the texture loader to take when loading the texture. See Texture Loading Options.

Return Value

A texture info object that describes the loaded texture or nil if an error occurred.

Discussion

This class method loads the texture into the sharegroup attached to the current context for the thread this method is called on.

See Also

Loading a Texture From a URL