tags:

views:

2064

answers:

2

I am looking at the EAGLView files from the apple iphone sample code and I am trying to understand how EAGLViewDelegate protocol

Note: I have pasted the relevant code

EAGLView.h

@protocol EAGLViewDelegate - (void) didResizeEAGLSurfaceForView:(EAGLView*)view; //Called whenever the EAGL surface has been resized @end

@interface EAGLView : UIView { @private id _delegate; }

@property(assign) id delegate;


EAGLView.m

@implementation EAGLView

@synthesize delegate = _delegate,

//...... @end

Question:

How does this didResizeEAGLSurfaceForView function get called? I don't see any implementation of it?

+1  A: 

I assume that you are referring to the CrashLanding, GLGravity, or GLPaint samples, as those samples are the only ones I can find with this protocol. The didResizeEAGLSurfaceForView: method is called in the MyEAGLView -_createSurface method. However, the method is not implemented anywhere, because the delegate is not set for the MyEAGLView in any of those samples.

So no, I don't think you're missing anything. This looks like vestigial code.

Brad Larson
+1  A: 

In GlPaint sample, how can I detect a single tap on the screen and pass this to the controlview?

Digital Robot