EAGLView.h not showing in ios 5.0

Am I trying to import "EAGLView.h" into xcode 4 and follow the instructions in the tutorial in the book http://www.amazon.com/Learning-iOS-Game-Programming-Hands-On/dp/0321699424/ref = sr_1_1? ie = UTF8 & qid = 1334873430 & sr = 8-1 . The book was written for previous versions of xcode, so I wonder if the EAGLView.h class was excluded, or if I need to do something special to import it?

When I created a new project, I chose the OpenGL game, if that matters.

+3
source share
1 answer

As I explain in this answer , EAGLView is not a Cocoa Touch built-in class. Apple began to use this name for the custom UIView that they used in their original application examples, and so many people copied and pasted this code, which many developers began to think that it was built into the system.

In general, all that these ordinary UIViews had in common was that they redefined the method +layerClassthis way:

+ (Class)layerClass 
{
    return [CAEAGLLayer class];
}

This means that instead of using the standard CALayer to support this subclass of UIView, this particular UIView will be supported using CAEAGLLayer. CAEAGLLayers is what provides OpenGL ES content rendering, so you will need something similar for your OpenGL ES application.

+4
source

All Articles