iOS Developer Library

Developer

GLKit Framework Reference GLKit Effects Constants Reference

Options
Deployment Target:

On This Page
Language:

GLKit Effects Constants Reference

GLKit effects implement shaders to perform their calculations. These shaders require vertex data to be provided by your application. All of the effects provided by GLKit use a consistent set of indices to reference vertex data provided by your application. When your application enables a vertex attribute array by calling the glEnableVertexAttribArray function, or specifies the vertex attribute pointer by calling the glVertexAttribPointer function, it uses one of these constants to specify the index parameter.

Constants

  • Values used as indices in OpenGL code to associate vertex data with an attribute in a named shader effect.

    Declaration

    Swift

    enum GLKVertexAttrib : GLint { case Position case Normal case Color case TexCoord0 case TexCoord1 }

    Objective-C

    typedef enum { GLKVertexAttribPosition, GLKVertexAttribNormal, GLKVertexAttribColor, GLKVertexAttribTexCoord0, GLKVertexAttribTexCoord1, } GLKVertexAttrib;

    Constants

    • Position

      GLKVertexAttribPosition

      This index is used to provide the vertex position to a shader.

      Available in iOS 5.0 and later.

    • Normal

      GLKVertexAttribNormal

      This index is used to provide the vertex normal to a shader.

      Available in iOS 5.0 and later.

    • Color

      GLKVertexAttribColor

      This index is used to provide the vertex color to a shader.

      Available in iOS 5.0 and later.

    • TexCoord0

      GLKVertexAttribTexCoord0

      This index is used to provide a set of texture coordinates to a shader.

      Available in iOS 5.0 and later.

    • TexCoord1

      GLKVertexAttribTexCoord1

      This index is used to provide the second set of texture coordinates to a shader.

      Available in iOS 5.0 and later.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.