Mac Developer Library

Developer

GLKit Framework Reference GLKEffectPropertyTexture Class Reference

Options
Deployment Target:

On This Page
Language:

GLKEffectPropertyTexture

The GLKEffectPropertyTexture class defines properties that are used to configure an OpenGL texturing operation. The texturing operation combines an input color and a color sampled from the texture and outputs a new color to the next stage of calculations. The envMode property determines the function used to calculate the output color from the two input colors.

If an effect only includes a single texture property, then the input color is the lighting color calculated by the lighting stage of the graphics pipeline. An effect can also include multiple GLKEffectPropertyTexture objects. When an effect includes multiple properties, the first texture stage uses the lighting color as the first input color. Each texture stage after that uses the output of the previous stage as the input color.

Inheritance


Conforms To


Import Statement


Swift

import GLKit

Objective-C

@import GLKit;

Availability


Available in OS X v10.8 and later.
  • enabled enabled Property

    A Boolean value that indicates whether this texture is used to texture drawn primitives.

    Declaration

    Swift

    var enabled: GLboolean

    Objective-C

    @property(nonatomic, assign) GLboolean enabled

    Discussion

    If the value is GL_TRUE, then the texture is applied to the primitive. If the value is GL_FALSE, the texture is skipped. The default value is GL_TRUE.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • envMode envMode Property

    The mode the texture uses to compute its output fragment color. See “Texturing Modes”.

    Declaration

    Swift

    var envMode: GLKTextureEnvMode

    Objective-C

    @property(nonatomic, assign) GLKTextureEnvMode envMode

    Discussion

    The default value is GLKTextureEnvModeModulate.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • name name Property

    The OpenGL name for the texture being sampled by this texture stage.

    Declaration

    Swift

    var name: GLuint

    Objective-C

    @property(nonatomic, assign) GLuint name

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • target target Property

    The kind of texture pointed to by the texture stage. See Texture Target Types.

    Declaration

    Swift

    var target: GLKTextureTarget

    Objective-C

    @property(nonatomic, assign) GLKTextureTarget target

    Discussion

    The default value is GLKTextureTarget2D.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • The kind of texture pointed to by the property.

    Declaration

    Swift

    enum GLKTextureTarget : GLenum { case Target2D case TargetCubeMap case TargetCt }

    Objective-C

    typedef enum { GLKTextureTarget2D = GL_TEXTURE_2D, GLKTextureTargetCubeMap = GL_TEXTURE_CUBE_MAP, GLKTextureTargetCt = 2 } GLKTextureTarget;

    Constants

    • Target2D

      GLKTextureTarget2D

      The texture is a 2D texture.

      Available in OS X v10.8 and later.

    • TargetCubeMap

      GLKTextureTargetCubeMap

      The texture is a set of six textures that make up a cube map.

      Available in OS X v10.8 and later.

    • TargetCt

      GLKTextureTargetCt

      The number of items in the enumeration.

      Available in OS X v10.8 and later.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.

  • The mode used to combine the texture with other color components.

    Declaration

    Swift

    enum GLKTextureEnvMode : GLint { case Replace case Modulate case Decal }

    Objective-C

    typedef enum { GLKTextureEnvModeReplace, GLKTextureEnvModeModulate, GLKTextureEnvModeDecal } GLKTextureEnvMode;

    Constants

    • Replace

      GLKTextureEnvModeReplace

      The output color is set to the color fetched from the texture. The input color is ignored.

      Available in OS X v10.8 and later.

    • Modulate

      GLKTextureEnvModeModulate

      The output color is calculated by multiplying the texture’s color by the input color.

      Available in OS X v10.8 and later.

    • Decal

      GLKTextureEnvModeDecal

      The output color is calculated by using the texture’s alpha component to blend the texture’s color with the input color.

      Available in OS X v10.8 and later.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in OS X v10.8 and later.