Question

I am adding a GLView to my app and along the way I have learned that I need to add the GLKit framework.

So when I was adding this framework, I realised there is a very similarly named framework called OpenGLES.framework.

I tried to look up the difference between these two frameworks on google, and I landed on this page.

This article seems to suggest I need an extra framework called QuartzCore.framework, which confused me even more.

I have the following questions:

1) How do these frameworks relate to each other?

2) It seems like GLView framework alone will enable GLView to work. When am I required to use the other two frameworks?

Was it helpful?

Solution

OpenGL ES is a cross-platform C API for GPU-accelerated drawing, particularly useful for 3D graphics and image processing. On iOS, you link against OpenGLES.framework, providing access to the cross-platform API and to the most basic iOS-specific APIs (EAGLContext and CAEAGLLayer) for using OpenGL ES in your app.

GLKit is an Apple-specific framework that adds extra features for making development of OpenGL ES-based apps easier, as nicely summed up in the tutorial you linked to:

  • GLKView/GLKViewController. These classes abstract out much of the boilerplate code it used to take to set up a basic OpenGL ES project.
  • GLKEffects. These classes implement common shading behaviors used in OpenGL ES 1.0, to make transitioning to OpenGL ES 2.0 easier. They’re also a handy way to get some basic lighting and texturing working.
  • GLMath. Prior to iOS 5, pretty much every game needed their own math library with common vector and matrix manipulation routines. Now with GLMath, most of the common math routines are there for you!
  • GLKTextureLoader. This class makes it much easier to load images as textures to be used in OpenGL. Rather than having to write a complicated method dealing with tons of different image formats, loading a texture is now a single method call!

If you link GLKit.framework, you get OpenGLES.framework for free — likewise if you import the GLKit headers, the OpenGL ES headers come along for the ride.

QuartzCore is for working directly with Core Animation layers. Before GLKit was introduced, you had to set up your own layers for getting OpenGL content onscreen — now GLKView does this on your behalf, so there's no need for QuartzCore unless you want to do extra fun stuff with Core Animation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top