Buck: GLKit encapsulates and standardizes many of the basic functions that every 3D iOS application needs. For example, the GLKView class encapsulates the entire code infrastructure needed to integrate 3D graphics. It combines Cocoa, Core Animation Layers and OpenGL ES. The GLKViewController class encapsulates the entire code infrastructure needed to display updates synchonously, automatically manages resources, and provides standard iOS behaviors such as orientation changes and interruptions when a call occurs. Only these two classes eliminate hundreds of lines of code that would otherwise be recreated for each 3D application, but more importantly, they standardize behavior. the alternative is that each developer restores the expected behavior, and some will inevitably implement the behavior suboptimally or completely incorrectly.
As another example, GLKit includes a standard mathematics library for 3D graphics. These mathematical functions can be called hundreds of millions per second, so it is important that they are fast. Anyone can download a free math library from the internet, but Apple is uniquely positioned to make its library the fastest on Apple devices. By including it in GLKit, Apple takes responsibility for debugging and optimizing the library. That`s a few hundred lines of code that are no longer needed in every 3D application.
Note: GLKView, GLKViewController and the math library implement functions that do not exist in any version of OpenGL ES. GLKit has capabilities that go far beyond that.
The GLKTextureLoader class should not remain unmentioned at this point. It makes it trivial to load and configure images called “textures” to make modern 3D graphics look realistic. That`s a few hundred lines of code you don`t have to write. GLKTextureLoader uses Apple`s proven Core Graphics framework in its implementation and protects you from having to know this library as well.
Sullivan: You mentioned that GLKit is still small and can grow. How do you see the change?
Buck: For the first version of GLKit, I think Apple focused on making it easy to get a 3D application running on iOS devices. This is especially important because Apple wants developers to use OpenGL ES 2.0. GLKit eliminates one of the main reasons why developers still choose the old version 1.1. GLKit makes getting started with OpenGL ES 2.0 as easy as with 1.1.
I see GLKit migrating to Mac OS X on the desktop. I don`t know Apple`s plans, but there is no technical reason for GLKit not to work on the desktop. Developers can then exchange 3D code between iOS and Mac OS X.
Above all, Apple shows us the direction into the future. GLKit classes like GLKReflectionMapEffect and GLKSkyboxEffect offer powerful features that have long been intended for graphic asistants and game developers. GLKit implements them on a high level via OpenGL and makes them easy and accessible for everyone. Apple hardly scratched the interface. I imagine a future GLKParticle effect class, a GLKArticulatedModelEffect class and a GLKBillboardEffect. Particles, structured models and billboards are all common wizard-level 3D graphics components, such as reflections maps and skyboxes. In fact, the examples for my new book. Learning OpenGL ES for iOS: A practical guide to modern 3D graphics programming with sample implementations of particle effects, structured models, and billboards. The examples show graphical concepts explained in the book and implement some of the example mini-games in the book. I hope and assume that the samples anticipate Apple`s intentions. At least for me they seemed to be obvious extensions of GLKit.