iOS Developer Library

Developer

GLKit Framework Reference GLKSkyboxEffect Class Reference

Options
Deployment Target:

On This Page
Language:

GLKSkyboxEffect

Inherits From


Conforms To


Import Statement


Swift

import GLKit

Objective-C

@import GLKit;

Availability


Available in iOS 5.0 and later

The GLKSkyboxEffect provides a standard skybox effect for your application. Unlike the GLKBaseEffect class, the skybox does not require your application to configure and submit vertex data. Instead, it creates its own vertex data based on the configuration data you supply.

At initialization time, your application first creates a compatible context and makes it current. Then, it creates new skybox effect, configures its properties, and calls its prepareToDraw method. Binding the effect causes a shader to be compiled and bound to the current context.

At rendering time, your application calls the effect’s prepareToDraw method to prepare the effect and then calls its draw method to draw the sky box.

  • label label Property

    A string used to name your effect.

    Declaration

    Swift

    var label: String!

    Objective-C

    @property(nonatomic, copy) NSString *label

    Discussion

    The name of the effect isn’t used directly by GLKit, but is printed when, for example, you log the object to the console via the NSLog function.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later

  • Prepares an effect for rendering.

    Declaration

    Swift

    func prepareToDraw()

    Objective-C

    - (void)prepareToDraw

    Discussion

    When the skybox shader is bound, the following state variables are altered:

    • GL_CURRENT_PROGRAM

    • GL_TEXTURE_BINDING_CUBE_MAP

    • GL_VERTEX_ARRAY_BINDING_OES

    • GL_VERTEX_ATTRIB_ARRAY_ENABLED

    Your application is responsible for saving and restoring these variables, if necessary for it to execute correctly.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later

  • Draws the skybox.

    Declaration

    Swift

    func draw()

    Objective-C

    - (void)draw

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later

  • The texture to apply to the skybox. (read-only)

    Declaration

    Swift

    var textureCubeMap: GLKEffectPropertyTexture! { get }

    Objective-C

    @property(nonatomic, readonly) GLKEffectPropertyTexture *textureCubeMap

    Discussion

    Your application should create a complete texture cube map in its initialization code. Then, assign the name of this texture to the textureCubeMap property of the skybox object.

    • skyboxEffect.textureCubeMap.glName = texture_name;

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later

  • center center Property

    The center of the skybox.

    Declaration

    Swift

    var center: GLKVector3

    Objective-C

    @property(nonatomic, assign) GLKVector3 center

    Discussion

    The property holds the [x,y,z] coordinates of the center of the skybox.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later

  • xSize xSize Property

    The width of the skybox.

    Declaration

    Swift

    var xSize: GLfloat

    Objective-C

    @property(nonatomic, assign) GLfloat xSize

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later

  • ySize ySize Property

    The height of the skybox.

    Declaration

    Swift

    var ySize: GLfloat

    Objective-C

    @property(nonatomic, assign) GLfloat ySize

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later

  • zSize zSize Property

    The depth of the skybox.

    Declaration

    Swift

    var zSize: GLfloat

    Objective-C

    @property(nonatomic, assign) GLfloat zSize

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later

  • transform transform Property

    The transform applied before drawing the skybox. (read-only)

    Declaration

    Swift

    var transform: GLKEffectPropertyTransform! { get }

    Objective-C

    @property(nonatomic, readonly) GLKEffectPropertyTransform *transform

    Discussion

    Your application uses this transform to set the position and orientation of the camera.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later