A view controller that manages an OpenGL ES rendering loop.
- iOS 5.0–12.0Deprecated
- tvOS 9.0–12.0Deprecated
GLKView object works in conjunction with a
GLKView object to display frames of animation in the view, and also provides standard view controller functionality.
To use this class, allocate and initialize a new
GLKView subclass and set its
view property to point to a
GLKView object. Then, configure the view controller’s
preferred property to the desired frame rate your application requires. You can set a delegate or configure other properties on the view controller, such as whether the animation loop is automatically paused or resumed when the application moves into the background.
When active, rendering loop automatically updates the view’s contents each time a new frame must be displayed. Each frame is rendered by the view controller using these steps:
Your application should subclass
GLKView and override the
view methods. Your
view method should set up your context and any drawable properties and can perform other resource allocation and initialization. Similarly, your class’s
view method should delete the drawable object and free any unneeded resources.
As an alternative to implementing a
glk method in a delegate, your subclass can provide an update method instead. The method must have the following signature: