iOS Developer Library

Developer

GLKit Framework Reference GLKTextureLoader Class Reference

Options
Deployment Target:

On This Page
Language:

GLKTextureLoader

The GLKTextureLoader class simplifies the effort required to load your texture data. The GLKTextureLoader class can load two-dimensional or cubemap textures in most image formats supported by the Image I/O framework. On iOS, it can also load textures compressed in the pvrtc format. It can load the data synchronously or asynchronously.

To load textures synchronously, make a context with the desired sharegroup the current context, and then call one or more of the class methods. The returned texture info object includes details about the loaded texture.

To load textures asynchronously, your initialization code allocates and initializes a new GLKTextureLoader object using the sharegroup object that should be the destination for new textures. Then, to load a texture, your app calls one of the texture loader’s instance methods, passing in a completion handler block to be called when the texture has been loaded.

The following OpenGL properties are set for a newly created, non-mipmapped texture:

  • GL_TEXTURE_MIN_FILTER:GL_LINEAR

  • GL_TEXTURE_MAG_FILTER:GL_LINEAR

  • GL_TEXTURE_WRAP_S:GL_CLAMP_TO_EDGE

  • GL_TEXTURE_WRAP_T:GL_CLAMP_TO_EDGE

The following OpenGL properties are set for a newly created, mipmapped texture:

  • GL_TEXTURE_MIN_FILTER:GL_LINEAR_MIPMAP_LINEAR

  • GL_TEXTURE_MAG_FILTER:GL_LINEAR

  • GL_TEXTURE_WRAP_S:GL_CLAMP_TO_EDGE

  • GL_TEXTURE_WRAP_T:GL_CLAMP_TO_EDGE

The GLKTextureLoader and GLKTextureInfo classes do not manage the OpenGL texture for you. Once the texture is returned to your app, you are responsible for it. This means that after your app is finished using an OpenGL texture, it must explicitly deallocate it by calling the glDeleteTextures function.

Inheritance


Conforms To


Import Statement


Swift

import GLKit

Objective-C

@import GLKit;

Availability


Available in iOS 5.0 and later.
  • Initializes a new texture loader object.

    Declaration

    Swift

    init!(sharegroup sharegroup: EAGLSharegroup!)

    Objective-C

    - (instancetype)initWithSharegroup:(EAGLSharegroup *)sharegroup

    Parameters

    sharegroup

    The sharegroup used to store new textures.

    Return Value

    A newly initialized texture loader.

    Discussion

    You only create a texture loader object when your app needs to load textures asynchronously.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    class func textureWithContentsOfFile(_ fileName: String!, options textureOperations: [NSObject : AnyObject]!, error outError: NSErrorPointer) -> GLKTextureInfo!

    Objective-C

    + (GLKTextureInfo *)textureWithContentsOfFile:(NSString *)fileName options:(NSDictionary *)textureOperations error:(NSError **)outError

    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

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

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • Asynchronously loads a 2D texture image from a file and creates a new texture from the data.

    Declaration

    Swift

    func textureWithContentsOfFile(_ fileName: String!, options textureOperations: [NSObject : AnyObject]!, queue queue: dispatch_queue_t!, completionHandler block: GLKTextureLoaderCallback!)

    Objective-C

    - (void)textureWithContentsOfFile:(NSString *)fileName options:(NSDictionary *)textureOperations queue:(dispatch_queue_t)queue completionHandler:(GLKTextureLoaderCallback)block

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

    queue

    A dispatch queue that your block is called on when the task completes. If NULL is passed, the block is called on the main dispatch queue.

    block

    A block to be called when the task completes.

    Discussion

    This method is identical to textureWithContentsOfFile:options:error:, except that it loads the texture asynchronously. When this method is called, it creates a new background task to handle the request and then returns control to your app. Later, when the task is complete, GLKit calls your completion handler on the queue you provided.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    class func textureWithCGImage(_ cgImage: CGImage!, options textureOperations: [NSObject : AnyObject]!, error outError: NSErrorPointer) -> GLKTextureInfo!

    Objective-C

    + (GLKTextureInfo *)textureWithCGImage:(CGImageRef)cgImage options:(NSDictionary *)textureOperations error:(NSError **)outError

    Parameters

    cgImage

    The Quartz image to be turned into a texture.

    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

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

    If the image was created using the CGBitmapImageContextCreate function, it must use one of the pixel formats described in Table 1. CGImages loaded from files typically are already in one of these formats.

    Table 1Supported Bitmap Formats

    Color Space

    Pixel format and bitmap information constant

    Null

    8 bpp, 8 bpc, kCGImageAlphaOnly

    Gray

    8 bpp, 8 bpc,kCGImageAlphaNone

    Gray

    8 bpp, 8 bpc,kCGImageAlphaOnly

    RGB

    32 bpp, 8 bpc, kCGImageAlphaNoneSkipFirst

    RGB

    32 bpp, 8 bpc, kCGImageAlphaPremultipliedFirst

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • Asynchronously loads a 2D texture image from a Quartz image and creates a new texture from the data.

    Declaration

    Swift

    func textureWithCGImage(_ cgImage: CGImage!, options textureOperations: [NSObject : AnyObject]!, queue queue: dispatch_queue_t!, completionHandler block: GLKTextureLoaderCallback!)

    Objective-C

    - (void)textureWithCGImage:(CGImageRef)cgImage options:(NSDictionary *)textureOperations queue:(dispatch_queue_t)queue completionHandler:(GLKTextureLoaderCallback)block

    Parameters

    cgImage

    The Quartz image to be turned into a texture.

    textureOperations

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

    queue

    A dispatch queue that your block is called on when the task completes. If NULL is passed, the block is called on the main dispatch queue.

    block

    A block to be called when the task completes.

    Discussion

    This method is identical to textureWithCGImage:options:error:, except that it loads the texture asynchronously. When this method is called, it creates a new background task to handle the request and then returns control to your app. Later, when the task is complete, GLKit calls your completion handler on the queue you provided.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    class func cubeMapWithContentsOfFile(_ fileName: String!, options textureOperations: [NSObject : AnyObject]!, error outError: NSErrorPointer) -> GLKTextureInfo!

    Objective-C

    + (GLKTextureInfo *)cubeMapWithContentsOfFile:(NSString *)fileName options:(NSDictionary *)textureOperations error:(NSError **)outError

    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.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    func cubeMapWithContentsOfFile(_ fileName: String!, options textureOperations: [NSObject : AnyObject]!, queue queue: dispatch_queue_t!, completionHandler block: GLKTextureLoaderCallback!)

    Objective-C

    - (void)cubeMapWithContentsOfFile:(NSString *)fileName options:(NSDictionary *)textureOperations queue:(dispatch_queue_t)queue completionHandler:(GLKTextureLoaderCallback)block

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

    queue

    A dispatch queue that your block is called on when the task completes. If NULL is passed, the block is called on the main dispatch queue.

    block

    A block to be called when the task completes.

    Discussion

    This method is identical to cubeMapWithContentsOfFile:options:error:, except that it loads the texture asynchronously. When this method is called, it creates a new background task to handle the request and then returns control to your app. Later, when the task is complete, GLKit calls your completion handler on the queue you provided.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    class func cubeMapWithContentsOfFiles(_ filePaths: [AnyObject]!, options textureOperations: [NSObject : AnyObject]!, error outError: NSErrorPointer) -> GLKTextureInfo!

    Objective-C

    + (GLKTextureInfo *)cubeMapWithContentsOfFiles:(NSArray *)filePaths options:(NSDictionary *)textureOperations error:(NSError **)outError

    Parameters

    filePaths

    An array of NSURL or NSString objects that provide the paths to the six files that make up the cube map.

    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 array of file paths must include six entries for the six faces of the cube map. The URLs should be arranged in the following order: Right(+x), Left(-x), Top(+y), Bottom(-y), Front(+z), Back(-z). This coordinate system is left-handed if you think of yourself within the cube. The coordinate system is right-handed if you think of yourself outside of the cube.

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

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    func cubeMapWithContentsOfFiles(_ filePaths: [AnyObject]!, options textureOperations: [NSObject : AnyObject]!, queue queue: dispatch_queue_t!, completionHandler block: GLKTextureLoaderCallback!)

    Objective-C

    - (void)cubeMapWithContentsOfFiles:(NSArray *)filePaths options:(NSDictionary *)textureOperations queue:(dispatch_queue_t)queue completionHandler:(GLKTextureLoaderCallback)block

    Parameters

    filePaths

    An array of paths to the six files that make up the cube map.

    textureOperations

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

    queue

    A dispatch queue that your block is called on when the task completes. If NULL is passed, the block is called on the main dispatch queue.

    block

    A block to be called when the task completes.

    Discussion

    This method is identical to cubeMapWithContentsOfURL:options:error:, except that it loads the texture asynchronously. When this method is called, it creates a new background task to handle the request and then returns control to your app. Later, when the task is complete, GLKit calls your completion handler on the queue you provided.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    class func cubeMapWithContentsOfURL(_ filePath: NSURL!, options textureOperations: [NSObject : AnyObject]!, error outError: NSErrorPointer) -> GLKTextureInfo!

    Objective-C

    + (GLKTextureInfo *)cubeMapWithContentsOfURL:(NSURL *)filePath options:(NSDictionary *)textureOperations error:(NSError **)outError

    Parameters

    filePath

    A path to the image 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: Right(+x), Left(-x), Top(+y), Bottom(-y), Front(+z), Back(-z). This coordinate system is left-handed if you think of yourself within the cube. The coordinate system is right-handed if you think of yourself outside of the cube.

    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.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    func cubeMapWithContentsOfURL(_ filePath: NSURL!, options textureOperations: [NSObject : AnyObject]!, queue queue: dispatch_queue_t!, completionHandler block: GLKTextureLoaderCallback!)

    Objective-C

    - (void)cubeMapWithContentsOfURL:(NSURL *)filePath options:(NSDictionary *)textureOperations queue:(dispatch_queue_t)queue completionHandler:(GLKTextureLoaderCallback)block

    Parameters

    filePath

    A path to the image 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”.

    queue

    A dispatch queue that your block is called on when the task completes. If NULL is passed, the block is called on the main dispatch queue.

    block

    A block to be called when the task completes.

    Discussion

    This method is identical to cubeMapWithContentsOfURL:options:error:, except that it loads the texture asynchronously. When this method is called, it creates a new background task to handle the request and then returns control to your app. Later, when the task is complete, GLKit calls your completion handler on the queue you provided.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

Data Types

  • Signature for the block executed after an asynchronous texture loading operation completes.

    Declaration

    Swift

    typealias GLKTextureLoaderCallback = (GLKTextureInfo!, NSError!) -> Void

    Objective-C

    typedef void (^GLKTextureLoaderCallback) (GLKTextureInfo *textureInfo, NSError *outError)

    Discussion

    The block parameters are defined as follows:

    textureInfo

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

    error

    If the operation was successful, this value is nil; otherwise, this parameter holds an object that describes the problem that occurred.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • Keys to specify in a textureOperations dictionary.

    Declaration

    Swift

    let GLKTextureLoaderApplyPremultiplication: NSString! let GLKTextureLoaderGenerateMipmaps: NSString! let GLKTextureLoaderOriginBottomLeft: NSString! let GLKTextureLoaderGrayscaleAsAlpha: NSString! let GLKTextureLoaderSRGB: NSString!

    Objective-C

    NSString *const GLKTextureLoaderApplyPremultiplication; NSString *const GLKTextureLoaderGenerateMipmaps; NSString *const GLKTextureLoaderOriginBottomLeft; NSString *const GLKTextureLoaderGrayscaleAsAlpha; NSString *const GLKTextureLoaderSRGB;

    Constants

    • GLKTextureLoaderApplyPremultiplication

      GLKTextureLoaderApplyPremultiplication

      This key specifies whether the data in the image should be premultiplied before being loaded into the sharegroup. The value for this key is an NSNumber object that specifies a boolean value. If NOfalse, the data is loaded into the sharegroup without being modified. If YEStrue, the red, green and blue components of each pixel are multiplied by the alpha value. If the key is not specified, the default value is NOfalse. Never specify YEStrue for a texture that is in a compressed format.

      Available in iOS 5.0 and later.

    • GLKTextureLoaderGenerateMipmaps

      GLKTextureLoaderGenerateMipmaps

      This key specifies whether mipmaps should be created for the texture. The value for this key is an NSNumber object that specifies a boolean value. If NOfalse, only the texture is loaded. If YEStrue, a full set of mipmap levels are generated for the texture when the texture is created. The GL_TEXTURE_MIN_FILTER parameter for the texture is changed to GL_LINEAR_MIPMAP_LINEAR when mipmaps are generated. If the key is not specified, the default value is NOfalse.

      Available in iOS 5.0 and later.

    • GLKTextureLoaderOriginBottomLeft

      GLKTextureLoaderOriginBottomLeft

      This key specifies whether the image data should be vertically flipped to match OpenGL’s coordinate system. The value for this key is an NSNumber object that specifies a boolean value. If NOfalse, the image data is not flipped. If YEStrue, the image data is flipped before being loaded. If the key is not specified, the default value is NOfalse.

      Available in iOS 5.0 and later.

    • GLKTextureLoaderGrayscaleAsAlpha

      GLKTextureLoaderGrayscaleAsAlpha

      This key specifies whether the image data in a grayscale image should be treated as alpha information. The value for this key is an NSNumber object that specifies a boolean value. If NOfalse, the image data is treated as luminance data. If YEStrue, the image data is treated as alpha data. The default value is NOfalse. This key is ignored if the source image is not a grayscale image.

      Available in iOS 5.0 and later.

    • GLKTextureLoaderSRGB

      GLKTextureLoaderSRGB

      This key specifies whether the image data in the texture should be treated as sRGB data. The value for this key is an NSNumber object that specifies a boolean value. If NOfalse, the image data is treated as linear pixel data. If YEStrue, the image data is treated as sRGB pixel data. The default value is NOfalse.

      Available in iOS 7.0 and later.

  • Strings used when handling NSError messages returned from a texture loading method.

    Declaration

    Swift

    let GLKTextureLoaderErrorDomain: NSString! let GLKTextureLoaderErrorKey: NSString! let GLKTextureLoaderGLErrorKey: NSString!

    Objective-C

    extern NSString *const GLKTextureLoaderErrorDomain; extern NSString *const GLKTextureLoaderErrorKey; extern NSString *const GLKTextureLoaderGLErrorKey;

    Constants

    • GLKTextureLoaderErrorDomain

      GLKTextureLoaderErrorDomain

      The error domain used by GLKit when returning texture loading errors.

      Available in iOS 5.0 and later.

    • GLKTextureLoaderErrorKey

      GLKTextureLoaderErrorKey

      A key used to retrieve an error string from an error object’s userInfo dictionary.

      Available in iOS 5.0 and later.

    • GLKTextureLoaderGLErrorKey

      GLKTextureLoaderGLErrorKey

      A key used to retrieve additional information from an error object’s userInfo dictionary.

      Available in iOS 5.0 and later.

  • Values to be returned in an NSError when a texture loader encounters an error.

    Declaration

    Swift

    enum GLKTextureLoaderError : GLuint { case FileOrURLNotFound case InvalidNSData case InvalidCGImage case UnknownPathType case UnknownFileType case PVRAtlasUnsupported case CubeMapInvalidNumFiles case CompressedTextureUpload case UncompressedTextureUpload case UnsupportedCubeMapDimensions case UnsupportedBitDepth case UnsupportedPVRFormat case DataPreprocessingFailure case MipmapUnsupported case UnsupportedOrientation case ReorientationFailure case AlphaPremultiplicationFailure case InvalidEAGLContext case IncompatibleFormatSRGB }

    Objective-C

    enum { GLKTextureLoaderErrorFileOrURLNotFound = 0, GLKTextureLoaderErrorInvalidNSData = 1, GLKTextureLoaderErrorInvalidCGImage = 2, GLKTextureLoaderErrorUnknownPathType = 3, GLKTextureLoaderErrorUnknownFileType = 4, GLKTextureLoaderErrorPVRAtlasUnsupported = 5, GLKTextureLoaderErrorCubeMapInvalidNumFiles = 6, GLKTextureLoaderErrorCompressedTextureUpload = 7, GLKTextureLoaderErrorUncompressedTextureUpload = 8, GLKTextureLoaderErrorUnsupportedCubeMapDimensions = 9, GLKTextureLoaderErrorUnsupportedBitDepth = 10, GLKTextureLoaderErrorUnsupportedPVRFormat = 11, GLKTextureLoaderErrorDataPreprocessingFailure = 12 GLKTextureLoaderErrorMipmapUnsupported = 13, GLKTextureLoaderErrorUnsupportedOrientation = 14, GLKTextureLoaderErrorReorientationFailure = 15, GLKTextureLoaderErrorAlphaPremultiplicationFailure = 16, GLKTextureLoaderErrorInvalidEAGLContext = 17 GLKTextureLoaderErrorIncompatibleFormatSRGB = 18 }; typedef NSUInteger GLKTextureLoaderError;

    Constants

    • FileOrURLNotFound

      GLKTextureLoaderErrorFileOrURLNotFound

      A file could not be found at the path provided.

      Available in iOS 5.0 and later.

    • InvalidNSData

      GLKTextureLoaderErrorInvalidNSData

      The data provided is not in a recognized image format.

      Available in iOS 5.0 and later.

    • InvalidCGImage

      GLKTextureLoaderErrorInvalidCGImage

      The CGImage provided was invalid.

      Available in iOS 5.0 and later.

    • UnknownPathType

      GLKTextureLoaderErrorUnknownPathType

      The path type was unrecognized.

      Available in iOS 5.0 and later.

    • UnknownFileType

      GLKTextureLoaderErrorUnknownFileType

      The file was in an unrecognized format.

      Available in iOS 5.0 and later.

    • PVRAtlasUnsupported

      GLKTextureLoaderErrorPVRAtlasUnsupported

      Cube maps may not be compressed in PVRTC format.

      Available in iOS 5.0 and later.

    • CubeMapInvalidNumFiles

      GLKTextureLoaderErrorCubeMapInvalidNumFiles

      The incorrect number of files were specified for the cube map.

      Available in iOS 5.0 and later.

    • CompressedTextureUpload

      GLKTextureLoaderErrorCompressedTextureUpload

      A compressed texture could not be uploaded.

      Available in iOS 5.0 and later.

    • UncompressedTextureUpload

      GLKTextureLoaderErrorUncompressedTextureUpload

      An uncompressed texture could not be uploaded.

      Available in iOS 5.0 and later.

    • UnsupportedCubeMapDimensions

      GLKTextureLoaderErrorUnsupportedCubeMapDimensions

      The cube map’s dimensions are incorrect.

      Available in iOS 5.0 and later.

    • UnsupportedBitDepth

      GLKTextureLoaderErrorUnsupportedBitDepth

      The data in the source image has an unsupported bit depth.

      Available in iOS 5.0 and later.

    • UnsupportedPVRFormat

      GLKTextureLoaderErrorUnsupportedPVRFormat

      The data in the PVRTC compressed format is in an unsupported format.

      Available in iOS 5.0 and later.

    • DataPreprocessingFailure

      GLKTextureLoaderErrorDataPreprocessingFailure

      The data could not be preprocessed correctly.

      Available in iOS 5.0 and later.

    • MipmapUnsupported

      GLKTextureLoaderErrorMipmapUnsupported

      The texture source data does not allow mipmaps to be generated.

      Available in iOS 5.0 and later.

    • UnsupportedOrientation

      GLKTextureLoaderErrorUnsupportedOrientation

      The texture source data is stored with an unsupported origin position.

      Available in iOS 5.0 and later.

    • ReorientationFailure

      GLKTextureLoaderErrorReorientationFailure

      The texture source data does not allow the image to be reoriented.

      Available in iOS 5.0 and later.

    • AlphaPremultiplicationFailure

      GLKTextureLoaderErrorAlphaPremultiplicationFailure

      The texture source data does not allow the alpha to be premultiplied.

      Available in iOS 5.0 and later.

    • InvalidEAGLContext

      GLKTextureLoaderErrorInvalidEAGLContext

      The EAGL context was not a valid context.

      Available in iOS 5.0 and later.

    • IncompatibleFormatSRGB

      GLKTextureLoaderErrorIncompatibleFormatSRGB

      The decoded data was in an incompatible format for an sRGB texture.

      Available in iOS 5.0 and later.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.