Type Method

cubeMap(withContentsOfFile:options:)

Loads a cube map texture image from a single file and creates a new texture from the data.

Declaration

class func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil) throws -> GLKTextureInfo

Parameters

fileName

A path to the file to load.

textureOperations

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

outError

If an error occurs, upon return contains an NSError object that describes the problem.

If you are not interested in this information, pass NULL.

Return Value

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

Discussion

The file is assumed to be a single image that includes the six faces of the cube map. The image’s height must be six times the width, and the images should be arranged in the following order from top to bottom: north, south, east, west, top, bottom. Alternatively, the image can have a width that is six times the height, and arranged from left to right, but this takes additional processing to load.

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 Cube Maps from Files

func cubeMap(withContentsOfFile: String, options: [String : NSNumber]?, queue: DispatchQueue?, completionHandler: GLKTextureLoaderCallback)

Asynchronously loads a cube map texture image from a single file and creates a new texture from the data.

Deprecated
class func cubeMap(withContentsOfFiles: [Any], options: [String : NSNumber]?) -> GLKTextureInfo

Loads a cube map texture image from a series of files and creates a new texture from the data.

Deprecated
func cubeMap(withContentsOfFiles: [Any], options: [String : NSNumber]?, queue: DispatchQueue?, completionHandler: GLKTextureLoaderCallback)

Asynchronously loads a cube map texture image from a series of files and creates a new texture from the data.

Deprecated