3

I am trying to import "EAGLView.h" in xcode 4 and am following the instructions given by 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 am wondering if the EAGLView.h class has been phased out or if there is something special I need to do to import it?

When i was creating the new project I selected OpenGL game if it makes any difference.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Simon Means
  • 230
  • 3
  • 11
  • I was successfull with this tutorial using xcode4: http://www.raywenderlich.com/3664/opengl-es-2-0-for-iphone-tutorial It may be a good place to start. – CuriousGeorge Apr 20 '12 at 04:14

1 Answers1

4

As I explain in this answer, EAGLView isn't a built-in Cocoa Touch class. Apple started using that name for a custom UIView they used in their initial sample applications, and so many people copied and pasted that code that many developers started thinking it was built in to the system.

In general, all that these custom UIViews had in common was that they overrode the +layerClass method in this fashion:

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

This indicates that instead of using the standard CALayer for backing this UIView subclass, this particular UIView will be backed with a CAEAGLLayer. CAEAGLLayers are what host OpenGL ES rendering content, so you'll need something like this for your OpenGL ES application.

Community
  • 1
  • 1
Brad Larson
  • 170,088
  • 45
  • 397
  • 571