GLKTextureInfo Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/GLKit.framework
Availability
Available in iOS 5.0 and later.
Declared in
GLKTextureLoader.h

Overview

When your app loads textures using the GLKTextureLoader class, the texture loader returns information about the textures using GLKTextureInfo objects. Your app never creates GLKTextureInfo objects directly.

Tasks

Reading Texture Information

Properties

alphaState

The state of the alpha component in the loaded texture. (read-only)

@property(readonly) GLKTextureInfoAlphaState alphaState
Availability
  • Available in iOS 5.0 and later.
Declared In
GLKTextureLoader.h

containsMipmaps

A Boolean value that states whether the loaded texture contains mip maps. (read-only)

@property(readonly) BOOL containsMipmaps
Availability
  • Available in iOS 5.0 and later.
Declared In
GLKTextureLoader.h

height

The height of the loaded texture. (read-only)

@property(readonly) GLuint height
Availability
  • Available in iOS 5.0 and later.
Declared In
GLKTextureLoader.h

name

The OpenGL context’s name for the texture. (read-only)

@property(readonly) GLuint name
Discussion

Your app uses this identifier whenever it wants to bind the texture to a context.

Availability
  • Available in iOS 5.0 and later.
Declared In
GLKTextureLoader.h

target

The OpenGL binding target for the texture. (read-only)

@property(readonly) GLenum target
Discussion

Your app uses this property as the target value when it binds the texture to a context.

Availability
  • Available in iOS 5.0 and later.
Declared In
GLKTextureLoader.h

textureOrigin

The location of the origin in the loaded texture. (read-only)

@property(readonly) GLKTextureInfoOrigin textureOrigin
Availability
  • Available in iOS 5.0 and later.
Declared In
GLKTextureLoader.h

width

The width of the loaded texture. (read-only)

@property(readonly) GLuint width
Availability
  • Available in iOS 5.0 and later.
Declared In
GLKTextureLoader.h

Constants

Texture Alpha Properties

Values that describe the alpha information stored in a source image’s pixel data.

enum {
   GLKTextureInfoAlphaStateNone = 0,
   GLKTextureInfoAlphaStateNonPremultiplied
   GLKTextureInfoAlphaStatePremultiplied
};
typedef NSUInteger GLKTextureInfoAlphaState;
Constants
GLKTextureInfoAlphaStateNone

Indicates that the texture has no alpha information.

Available in iOS 5.0 and later.

Declared in GLKTextureLoader.h.

GLKTextureInfoAlphaStateNonPremultiplied

Indicates that the color values in the texture were not premultiplied by the alpha value.

Available in iOS 5.0 and later.

Declared in GLKTextureLoader.h.

GLKTextureInfoAlphaStatePremultiplied

Indicates that the color values in the texture have already been premultiplied by the alpha value.

Available in iOS 5.0 and later.

Declared in GLKTextureLoader.h.

Texture Origin Properties

The location of the origin in the original source image.

enum {
   GLKTextureInfoOriginUnknown = 0,
   GLKTextureInfoOriginTopLeft,
   GLKTextureInfoOriginBottomLeft
};
typedef NSUInteger GLKTextureInfoOrigin;
Constants
GLKTextureInfoOriginUnknown

The origin of the texture is not supported.

Available in iOS 5.0 and later.

Declared in GLKTextureLoader.h.

GLKTextureInfoOriginTopLeft

The origin of the texture is in the top left corner.

Available in iOS 5.0 and later.

Declared in GLKTextureLoader.h.

GLKTextureInfoOriginBottomLeft

The origin of the texture is in the bottom left corner.

Available in iOS 5.0 and later.

Declared in GLKTextureLoader.h.

Discussion

The origin’s position has no effect on how the texture is loaded into the context. If you need to flip the image before loading it, your app must explicitly add the GLKTextureOriginBottomLeft key to the options dictionary provided when loading the texture.