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