annotate Classes/EAGLView.h @ 3:d63043d62684

Minor fixes, clean ups, comments to make script more presentable.
author Eric Wing <ewing@anscamobile.com>
date Mon, 01 Aug 2011 15:49:45 -0700
parents 5ec52341f221
children
rev   line source
0
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
1 //
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
2 // EAGLView.h
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
3 // MySampleProject
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
4 //
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
5 // Created by Eric Wing on 7/29/11.
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
6 // Copyright 2011 __MyCompanyName__. All rights reserved.
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
7 //
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
8
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
9 #import <UIKit/UIKit.h>
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
10
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
11 #import <OpenGLES/ES1/gl.h>
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
12 #import <OpenGLES/ES1/glext.h>
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
13 #import <OpenGLES/ES2/gl.h>
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
14 #import <OpenGLES/ES2/glext.h>
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
15
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
16 // This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
17 // The view content is basically an EAGL surface you render your OpenGL scene into.
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
18 // Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
19 @interface EAGLView : UIView
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
20 {
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
21 @private
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
22 EAGLContext *context;
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
23
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
24 // The pixel dimensions of the CAEAGLLayer.
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
25 GLint framebufferWidth;
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
26 GLint framebufferHeight;
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
27
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
28 // The OpenGL ES names for the framebuffer and renderbuffer used to render to this view.
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
29 GLuint defaultFramebuffer, colorRenderbuffer;
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
30 }
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
31
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
32 @property (nonatomic, retain) EAGLContext *context;
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
33
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
34 - (void)setFramebuffer;
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
35 - (BOOL)presentFramebuffer;
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
36
5ec52341f221 Initial commit
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
37 @end