This is a rather open-ended question, so it's probably best to start by getting yourself some background with GLKit and then ask more questions if you have specific issues.
Take a look at the code you get when creating a new Xcode project using the "OpenGL Game" template -- this sets up a GLKView
and GLKViewController
for you. There's also some description of how these classes work and how to use them in Apple's OpenGL ES Programming Guide.
The overall gist of it: GLKView
does all of the framebuffer, renderbuffer, and viewport setup and presentation for basic OpenGL ES drawing (including all the extra framebuffer juggling for multisampling if you want that) so that all you have to do is issue drawing commands. GLKViewController
owns a GLKView
and runs an animation timer that calls your drawing code -- by default, it makes sure not to call your drawing code when the app is in the background.
If you're using GLKViewController
and only making OpenGL ES calls from the GLKView
(subclass or delegate) drawing method, you shouldn't have to worry about crashing due to GPU use in the background. If you are seeing such crashes (with gpus_ReturnNotPermittedKillClient
in the stack trace), it can help to try forcing the GL to complete processing before going to the background -- call glFinish()
in applicationWillResignActive:
.