├── simpleFBO ├── en.lproj │ ├── InfoPlist.strings │ └── MainStoryboard.storyboard ├── AppDelegate.h ├── simpleFBO-Prefix.pch ├── main.m ├── Shaders │ ├── Shader.fsh │ └── Shader.vsh ├── ViewController.h ├── simpleFBO-Info.plist ├── AppDelegate.m └── ViewController.m └── simpleFBO.xcodeproj ├── xcuserdata └── mahesh.xcuserdatad │ ├── xcdebugger │ └── Breakpoints.xcbkptlist │ └── xcschemes │ ├── xcschememanagement.plist │ └── simpleFBO.xcscheme ├── project.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── mahesh.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── WorkspaceSettings.xcsettings └── project.pbxproj /simpleFBO/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /simpleFBO.xcodeproj/xcuserdata/mahesh.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /simpleFBO.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /simpleFBO.xcodeproj/project.xcworkspace/xcuserdata/mahesh.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glman74/simpleFBO/HEAD/simpleFBO.xcodeproj/project.xcworkspace/xcuserdata/mahesh.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /simpleFBO/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // simpleFBO 4 | // 5 | // Created by Mahesh Venkitachalam on 27/06/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /simpleFBO/simpleFBO-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'simpleFBO' target in the 'simpleFBO' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /simpleFBO/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // simpleFBO 4 | // 5 | // Created by Mahesh Venkitachalam on 27/06/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /simpleFBO.xcodeproj/project.xcworkspace/xcuserdata/mahesh.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /simpleFBO/Shaders/Shader.fsh: -------------------------------------------------------------------------------- 1 | // 2 | // Shader.fsh 3 | // simpleFBO 4 | // 5 | // Created by Mahesh Venkitachalam on 27/06/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | uniform sampler2D uSampler; 10 | 11 | varying lowp vec2 vTexCoord; 12 | 13 | varying lowp vec4 colorVarying; 14 | 15 | void main() 16 | { 17 | lowp vec4 texCol = texture2D(uSampler, vTexCoord); 18 | 19 | gl_FragColor = vec4(texCol.rgb, 1.0); 20 | //gl_FragColor = colorVarying; 21 | } 22 | -------------------------------------------------------------------------------- /simpleFBO.xcodeproj/xcuserdata/mahesh.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | simpleFBO.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 3DDEFC9C159B640C00B4EC41 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /simpleFBO/Shaders/Shader.vsh: -------------------------------------------------------------------------------- 1 | // 2 | // Shader.vsh 3 | // simpleFBO 4 | // 5 | // Created by Mahesh Venkitachalam on 27/06/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | attribute vec4 position; 10 | attribute vec3 normal; 11 | attribute vec2 aTexCoord; 12 | 13 | varying lowp vec2 vTexCoord; 14 | 15 | varying lowp vec4 colorVarying; 16 | 17 | uniform mat4 modelViewProjectionMatrix; 18 | uniform mat3 normalMatrix; 19 | 20 | void main() 21 | { 22 | vec3 eyeNormal = normalize(normalMatrix * normal); 23 | vec3 lightPosition = vec3(0.0, 0.0, 1.0); 24 | vec4 diffuseColor = vec4(0.4, 0.4, 1.0, 1.0); 25 | 26 | float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition))); 27 | 28 | colorVarying = diffuseColor * nDotVP; 29 | 30 | gl_Position = modelViewProjectionMatrix * position; 31 | 32 | // pass to fragment shader 33 | vTexCoord = aTexCoord; 34 | } 35 | -------------------------------------------------------------------------------- /simpleFBO/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // simpleFBO 4 | // 5 | // Created by Mahesh Venkitachalam on 27/06/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ViewController : GLKViewController 13 | { 14 | GLuint _program; 15 | 16 | GLKMatrix4 _modelViewProjectionMatrix; 17 | GLKMatrix3 _normalMatrix; 18 | float _rotation; 19 | 20 | GLuint _vertexArray; 21 | GLuint _vertexBuffer; 22 | GLuint _texCoordBuffer; 23 | 24 | int uSamplerLoc; 25 | int aTexCoordLoc; 26 | 27 | // FBO variables 28 | GLuint fboHandle; 29 | GLuint depthBuffer; 30 | GLuint fboTex; 31 | int fbo_width; 32 | int fbo_height; 33 | 34 | // test 35 | GLuint texId; 36 | 37 | // GL context 38 | EAGLContext *glContext; 39 | 40 | GLint defaultFBO; 41 | } 42 | 43 | //@property (strong, nonatomic) GLKBaseEffect *effect; 44 | 45 | - (void)setupGL; 46 | - (void)tearDownGL; 47 | - (void)setupFBO; 48 | 49 | 50 | - (BOOL)loadShaders; 51 | - (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file; 52 | - (BOOL)linkProgram:(GLuint)prog; 53 | - (BOOL)validateProgram:(GLuint)prog; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /simpleFBO/simpleFBO-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | vc.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | MainStoryboard 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarHidden 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /simpleFBO/en.lproj/MainStoryboard.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /simpleFBO/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // simpleFBO 4 | // 5 | // Created by Mahesh Venkitachalam on 27/06/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | @synthesize window = _window; 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | // Override point for customization after application launch. 18 | return YES; 19 | } 20 | 21 | - (void)applicationWillResignActive:(UIApplication *)application 22 | { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | - (void)applicationDidEnterBackground:(UIApplication *)application 28 | { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application 34 | { 35 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 36 | } 37 | 38 | - (void)applicationDidBecomeActive:(UIApplication *)application 39 | { 40 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 41 | } 42 | 43 | - (void)applicationWillTerminate:(UIApplication *)application 44 | { 45 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /simpleFBO.xcodeproj/xcuserdata/mahesh.xcuserdatad/xcschemes/simpleFBO.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 38 | 39 | 40 | 41 | 50 | 51 | 57 | 58 | 59 | 60 | 61 | 62 | 68 | 69 | 75 | 76 | 77 | 78 | 80 | 81 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /simpleFBO/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // simpleFBO 4 | // 5 | // Created by Mahesh Venkitachalam on 27/06/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ViewController.h" 12 | 13 | #define BUFFER_OFFSET(i) ((char *)NULL + (i)) 14 | 15 | // Uniform index. 16 | enum 17 | { 18 | UNIFORM_MODELVIEWPROJECTION_MATRIX, 19 | UNIFORM_NORMAL_MATRIX, 20 | NUM_UNIFORMS 21 | }; 22 | GLint uniforms[NUM_UNIFORMS]; 23 | 24 | // Attribute index. 25 | enum 26 | { 27 | ATTRIB_VERTEX, 28 | ATTRIB_NORMAL, 29 | NUM_ATTRIBUTES 30 | }; 31 | 32 | GLfloat gVertexData[] = 33 | { 34 | 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 35 | -0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 36 | 0.5f, -0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 37 | -0.5f, -0.5f, 0.0f, 0.0f, 0.0f, 1.0f 38 | }; 39 | 40 | GLfloat gTexCoordData[] = 41 | { 42 | 1.0f, 1.0f, 43 | 0.0f, 1.0f, 44 | 1.0f, 0.0f, 45 | 0.0f, 0.0f 46 | }; 47 | 48 | @implementation ViewController 49 | 50 | - (void)viewDidLoad 51 | { 52 | [super viewDidLoad]; 53 | 54 | glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; 55 | 56 | if (!glContext) { 57 | NSLog(@"Failed to create ES context"); 58 | } 59 | 60 | GLKView *view = (GLKView *)self.view; 61 | view.context = glContext; 62 | view.drawableDepthFormat = GLKViewDrawableDepthFormat24; 63 | 64 | [self setupGL]; 65 | } 66 | 67 | - (void)viewDidUnload 68 | { 69 | [super viewDidUnload]; 70 | 71 | [self tearDownGL]; 72 | 73 | if ([EAGLContext currentContext] == glContext) { 74 | [EAGLContext setCurrentContext:nil]; 75 | } 76 | glContext = nil; 77 | } 78 | 79 | - (void)didReceiveMemoryWarning 80 | { 81 | [super didReceiveMemoryWarning]; 82 | // Release any cached data, images, etc. that aren't in use. 83 | } 84 | 85 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 86 | { 87 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 88 | return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 89 | } else { 90 | return YES; 91 | } 92 | } 93 | 94 | - (void)setupGL 95 | { 96 | [EAGLContext setCurrentContext:glContext]; 97 | 98 | [self loadShaders]; 99 | 100 | glEnable(GL_DEPTH_TEST); 101 | 102 | glGenBuffers(1, &_vertexBuffer); 103 | glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); 104 | glBufferData(GL_ARRAY_BUFFER, sizeof(gVertexData), gVertexData, GL_STATIC_DRAW); 105 | 106 | glEnableVertexAttribArray(GLKVertexAttribPosition); 107 | glVertexAttribPointer(GLKVertexAttribPosition, 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(0)); 108 | glEnableVertexAttribArray(GLKVertexAttribNormal); 109 | glVertexAttribPointer(GLKVertexAttribNormal, 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(12)); 110 | 111 | glGenBuffers(1, &_texCoordBuffer); 112 | glBindBuffer(GL_ARRAY_BUFFER, _texCoordBuffer); 113 | glBufferData(GL_ARRAY_BUFFER, sizeof(gTexCoordData), gTexCoordData, GL_STATIC_DRAW); 114 | // get text coord attribute index 115 | aTexCoordLoc = glGetAttribLocation(_program, "aTexCoord"); 116 | glEnableVertexAttribArray(aTexCoordLoc); 117 | glVertexAttribPointer(aTexCoordLoc, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0)); 118 | // get sampler location 119 | uSamplerLoc = glGetUniformLocation(_program, "uSampler"); 120 | 121 | // initialize FBO 122 | [self setupFBO]; 123 | 124 | // to test texturing 125 | GLubyte tex[] = {255, 0, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 255, 0, 0, 255}; 126 | glActiveTexture(GL_TEXTURE0); 127 | glGenTextures(1, &texId); 128 | glBindTexture(GL_TEXTURE_2D, texId); 129 | glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); 130 | glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); 131 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 132 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 133 | glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, tex); 134 | glBindTexture(GL_TEXTURE_2D, 0); 135 | } 136 | 137 | - (void)tearDownGL 138 | { 139 | [EAGLContext setCurrentContext:glContext]; 140 | 141 | glDeleteBuffers(1, &_vertexBuffer); 142 | 143 | if (_program) { 144 | glDeleteProgram(_program); 145 | _program = 0; 146 | } 147 | } 148 | 149 | #pragma mark - GLKView and GLKViewController delegate methods 150 | 151 | - (void)update 152 | { 153 | float aspect = fabsf(self.view.bounds.size.width / self.view.bounds.size.height); 154 | GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 0.1f, 100.0f); 155 | 156 | // Compute the model view matrix for the object rendered with ES2 157 | GLKMatrix4 modelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, -2.0f); 158 | modelViewMatrix = GLKMatrix4Rotate(modelViewMatrix, _rotation, 1.0f, 1.0f, 1.0f); 159 | 160 | _normalMatrix = GLKMatrix3InvertAndTranspose(GLKMatrix4GetMatrix3(modelViewMatrix), NULL); 161 | 162 | _modelViewProjectionMatrix = GLKMatrix4Multiply(projectionMatrix, modelViewMatrix); 163 | 164 | _rotation += self.timeSinceLastUpdate * 0.5f; 165 | } 166 | 167 | - (void)glkView:(GLKView *)view drawInRect:(CGRect)rect 168 | { 169 | // render FBO tex 170 | [self renderFBO]; 171 | 172 | // reset to main framebuffer 173 | [((GLKView *) self.view) bindDrawable]; 174 | 175 | glViewport(0, 0, self.view.bounds.size.width, self.view.bounds.size.height); 176 | // render main 177 | glClearColor(0.65f, 0.65f, 0.65f, 1.0f); 178 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 179 | 180 | glEnable(GL_TEXTURE_2D); 181 | glActiveTexture(GL_TEXTURE0); 182 | 183 | // Render 184 | glUseProgram(_program); 185 | 186 | glUniform1i(uSamplerLoc, 0); 187 | 188 | glUniformMatrix4fv(uniforms[UNIFORM_MODELVIEWPROJECTION_MATRIX], 1, 0, _modelViewProjectionMatrix.m); 189 | glUniformMatrix3fv(uniforms[UNIFORM_NORMAL_MATRIX], 1, 0, _normalMatrix.m); 190 | 191 | // bind to fbo texture 192 | glBindTexture(GL_TEXTURE_2D, fboTex); 193 | 194 | // uncomment line below and comment out[self renderFBO]; above to test with normal texture 195 | // glBindTexture(GL_TEXTURE_2D, texId); 196 | 197 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 198 | 199 | glDisable(GL_TEXTURE_2D); 200 | } 201 | 202 | #pragma mark - FBO 203 | 204 | // intialize FBO 205 | - (void)setupFBO 206 | { 207 | fbo_width = 512; 208 | fbo_height = 512; 209 | 210 | glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO); 211 | 212 | glGenFramebuffers(1, &fboHandle); 213 | glGenTextures(1, &fboTex); 214 | glGenRenderbuffers(1, &depthBuffer); 215 | 216 | glBindFramebuffer(GL_FRAMEBUFFER, fboHandle); 217 | 218 | glBindTexture(GL_TEXTURE_2D, fboTex); 219 | glTexImage2D( GL_TEXTURE_2D, 220 | 0, 221 | GL_RGBA, 222 | fbo_width, fbo_height, 223 | 0, 224 | GL_RGBA, 225 | GL_UNSIGNED_BYTE, 226 | NULL); 227 | 228 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 229 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 230 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 231 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 232 | 233 | 234 | glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboTex, 0); 235 | 236 | glBindRenderbuffer(GL_RENDERBUFFER, depthBuffer); 237 | glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24_OES, fbo_width, fbo_height); 238 | 239 | glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBuffer); 240 | 241 | // FBO status check 242 | GLenum status; 243 | status = glCheckFramebufferStatus(GL_FRAMEBUFFER); 244 | switch(status) { 245 | case GL_FRAMEBUFFER_COMPLETE: 246 | NSLog(@"fbo complete"); 247 | break; 248 | 249 | case GL_FRAMEBUFFER_UNSUPPORTED: 250 | NSLog(@"fbo unsupported"); 251 | break; 252 | 253 | default: 254 | /* programming error; will fail on all hardware */ 255 | NSLog(@"Framebuffer Error"); 256 | break; 257 | } 258 | 259 | glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); 260 | } 261 | 262 | // render FBO 263 | - (void)renderFBO 264 | { 265 | glBindTexture(GL_TEXTURE_2D, 0); 266 | glEnable(GL_TEXTURE_2D); 267 | glBindFramebuffer(GL_FRAMEBUFFER, fboHandle); 268 | 269 | glViewport(0,0, fbo_width, fbo_height); 270 | glClearColor(0.0f, 1.0f, 0.0f, 1.0f); 271 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 272 | 273 | glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); 274 | } 275 | 276 | 277 | #pragma mark - OpenGL ES 2 shader compilation 278 | 279 | - (BOOL)loadShaders 280 | { 281 | GLuint vertShader, fragShader; 282 | NSString *vertShaderPathname, *fragShaderPathname; 283 | 284 | // Create shader program. 285 | _program = glCreateProgram(); 286 | 287 | // Create and compile vertex shader. 288 | vertShaderPathname = [[NSBundle mainBundle] pathForResource:@"Shader" ofType:@"vsh"]; 289 | if (![self compileShader:&vertShader type:GL_VERTEX_SHADER file:vertShaderPathname]) { 290 | NSLog(@"Failed to compile vertex shader"); 291 | return NO; 292 | } 293 | 294 | // Create and compile fragment shader. 295 | fragShaderPathname = [[NSBundle mainBundle] pathForResource:@"Shader" ofType:@"fsh"]; 296 | if (![self compileShader:&fragShader type:GL_FRAGMENT_SHADER file:fragShaderPathname]) { 297 | NSLog(@"Failed to compile fragment shader"); 298 | return NO; 299 | } 300 | 301 | // Attach vertex shader to program. 302 | glAttachShader(_program, vertShader); 303 | 304 | // Attach fragment shader to program. 305 | glAttachShader(_program, fragShader); 306 | 307 | // Bind attribute locations. 308 | // This needs to be done prior to linking. 309 | glBindAttribLocation(_program, ATTRIB_VERTEX, "position"); 310 | glBindAttribLocation(_program, ATTRIB_NORMAL, "normal"); 311 | 312 | // Link program. 313 | if (![self linkProgram:_program]) { 314 | NSLog(@"Failed to link program: %d", _program); 315 | 316 | if (vertShader) { 317 | glDeleteShader(vertShader); 318 | vertShader = 0; 319 | } 320 | if (fragShader) { 321 | glDeleteShader(fragShader); 322 | fragShader = 0; 323 | } 324 | if (_program) { 325 | glDeleteProgram(_program); 326 | _program = 0; 327 | } 328 | 329 | return NO; 330 | } 331 | 332 | // Get uniform locations. 333 | uniforms[UNIFORM_MODELVIEWPROJECTION_MATRIX] = glGetUniformLocation(_program, "modelViewProjectionMatrix"); 334 | uniforms[UNIFORM_NORMAL_MATRIX] = glGetUniformLocation(_program, "normalMatrix"); 335 | 336 | // Release vertex and fragment shaders. 337 | if (vertShader) { 338 | glDetachShader(_program, vertShader); 339 | glDeleteShader(vertShader); 340 | } 341 | if (fragShader) { 342 | glDetachShader(_program, fragShader); 343 | glDeleteShader(fragShader); 344 | } 345 | 346 | return YES; 347 | } 348 | 349 | - (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file 350 | { 351 | GLint status; 352 | const GLchar *source; 353 | 354 | source = (GLchar *)[[NSString stringWithContentsOfFile:file encoding:NSUTF8StringEncoding error:nil] UTF8String]; 355 | if (!source) { 356 | NSLog(@"Failed to load vertex shader"); 357 | return NO; 358 | } 359 | 360 | *shader = glCreateShader(type); 361 | glShaderSource(*shader, 1, &source, NULL); 362 | glCompileShader(*shader); 363 | 364 | #if defined(DEBUG) 365 | GLint logLength; 366 | glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength); 367 | if (logLength > 0) { 368 | GLchar *log = (GLchar *)malloc(logLength); 369 | glGetShaderInfoLog(*shader, logLength, &logLength, log); 370 | NSLog(@"Shader compile log:\n%s", log); 371 | free(log); 372 | } 373 | #endif 374 | 375 | glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); 376 | if (status == 0) { 377 | glDeleteShader(*shader); 378 | return NO; 379 | } 380 | 381 | return YES; 382 | } 383 | 384 | - (BOOL)linkProgram:(GLuint)prog 385 | { 386 | GLint status; 387 | glLinkProgram(prog); 388 | 389 | #if defined(DEBUG) 390 | GLint logLength; 391 | glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); 392 | if (logLength > 0) { 393 | GLchar *log = (GLchar *)malloc(logLength); 394 | glGetProgramInfoLog(prog, logLength, &logLength, log); 395 | NSLog(@"Program link log:\n%s", log); 396 | free(log); 397 | } 398 | #endif 399 | 400 | glGetProgramiv(prog, GL_LINK_STATUS, &status); 401 | if (status == 0) { 402 | return NO; 403 | } 404 | 405 | return YES; 406 | } 407 | 408 | - (BOOL)validateProgram:(GLuint)prog 409 | { 410 | GLint logLength, status; 411 | 412 | glValidateProgram(prog); 413 | glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); 414 | if (logLength > 0) { 415 | GLchar *log = (GLchar *)malloc(logLength); 416 | glGetProgramInfoLog(prog, logLength, &logLength, log); 417 | NSLog(@"Program validate log:\n%s", log); 418 | free(log); 419 | } 420 | 421 | glGetProgramiv(prog, GL_VALIDATE_STATUS, &status); 422 | if (status == 0) { 423 | return NO; 424 | } 425 | 426 | return YES; 427 | } 428 | 429 | @end 430 | -------------------------------------------------------------------------------- /simpleFBO.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3DDEFCA2159B640C00B4EC41 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DDEFCA1159B640C00B4EC41 /* UIKit.framework */; }; 11 | 3DDEFCA4159B640C00B4EC41 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DDEFCA3159B640C00B4EC41 /* Foundation.framework */; }; 12 | 3DDEFCA6159B640C00B4EC41 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DDEFCA5159B640C00B4EC41 /* CoreGraphics.framework */; }; 13 | 3DDEFCA8159B640C00B4EC41 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DDEFCA7159B640C00B4EC41 /* GLKit.framework */; }; 14 | 3DDEFCAA159B640C00B4EC41 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DDEFCA9159B640C00B4EC41 /* OpenGLES.framework */; }; 15 | 3DDEFCB0159B640C00B4EC41 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3DDEFCAE159B640C00B4EC41 /* InfoPlist.strings */; }; 16 | 3DDEFCB2159B640C00B4EC41 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DDEFCB1159B640C00B4EC41 /* main.m */; }; 17 | 3DDEFCB6159B640C00B4EC41 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DDEFCB5159B640C00B4EC41 /* AppDelegate.m */; }; 18 | 3DDEFCB9159B640C00B4EC41 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3DDEFCB7159B640C00B4EC41 /* MainStoryboard.storyboard */; }; 19 | 3DDEFCBB159B640C00B4EC41 /* Shader.fsh in Resources */ = {isa = PBXBuildFile; fileRef = 3DDEFCBA159B640C00B4EC41 /* Shader.fsh */; }; 20 | 3DDEFCBD159B640C00B4EC41 /* Shader.vsh in Resources */ = {isa = PBXBuildFile; fileRef = 3DDEFCBC159B640C00B4EC41 /* Shader.vsh */; }; 21 | 3DDEFCC0159B640C00B4EC41 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DDEFCBF159B640C00B4EC41 /* ViewController.m */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | 3DDEFC9D159B640C00B4EC41 /* simpleFBO.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = simpleFBO.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | 3DDEFCA1159B640C00B4EC41 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 27 | 3DDEFCA3159B640C00B4EC41 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 28 | 3DDEFCA5159B640C00B4EC41 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 29 | 3DDEFCA7159B640C00B4EC41 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; 30 | 3DDEFCA9159B640C00B4EC41 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 31 | 3DDEFCAD159B640C00B4EC41 /* simpleFBO-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "simpleFBO-Info.plist"; sourceTree = ""; }; 32 | 3DDEFCAF159B640C00B4EC41 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 33 | 3DDEFCB1159B640C00B4EC41 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | 3DDEFCB3159B640C00B4EC41 /* simpleFBO-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "simpleFBO-Prefix.pch"; sourceTree = ""; }; 35 | 3DDEFCB4159B640C00B4EC41 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 36 | 3DDEFCB5159B640C00B4EC41 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 37 | 3DDEFCB8159B640C00B4EC41 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; 38 | 3DDEFCBA159B640C00B4EC41 /* Shader.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = Shader.fsh; path = Shaders/Shader.fsh; sourceTree = ""; }; 39 | 3DDEFCBC159B640C00B4EC41 /* Shader.vsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = Shader.vsh; path = Shaders/Shader.vsh; sourceTree = ""; }; 40 | 3DDEFCBE159B640C00B4EC41 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 41 | 3DDEFCBF159B640C00B4EC41 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 42 | /* End PBXFileReference section */ 43 | 44 | /* Begin PBXFrameworksBuildPhase section */ 45 | 3DDEFC9A159B640C00B4EC41 /* Frameworks */ = { 46 | isa = PBXFrameworksBuildPhase; 47 | buildActionMask = 2147483647; 48 | files = ( 49 | 3DDEFCA2159B640C00B4EC41 /* UIKit.framework in Frameworks */, 50 | 3DDEFCA4159B640C00B4EC41 /* Foundation.framework in Frameworks */, 51 | 3DDEFCA6159B640C00B4EC41 /* CoreGraphics.framework in Frameworks */, 52 | 3DDEFCA8159B640C00B4EC41 /* GLKit.framework in Frameworks */, 53 | 3DDEFCAA159B640C00B4EC41 /* OpenGLES.framework in Frameworks */, 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | /* End PBXFrameworksBuildPhase section */ 58 | 59 | /* Begin PBXGroup section */ 60 | 3DDEFC92159B640C00B4EC41 = { 61 | isa = PBXGroup; 62 | children = ( 63 | 3DDEFCAB159B640C00B4EC41 /* simpleFBO */, 64 | 3DDEFCA0159B640C00B4EC41 /* Frameworks */, 65 | 3DDEFC9E159B640C00B4EC41 /* Products */, 66 | ); 67 | sourceTree = ""; 68 | }; 69 | 3DDEFC9E159B640C00B4EC41 /* Products */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 3DDEFC9D159B640C00B4EC41 /* simpleFBO.app */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | 3DDEFCA0159B640C00B4EC41 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 3DDEFCA1159B640C00B4EC41 /* UIKit.framework */, 81 | 3DDEFCA3159B640C00B4EC41 /* Foundation.framework */, 82 | 3DDEFCA5159B640C00B4EC41 /* CoreGraphics.framework */, 83 | 3DDEFCA7159B640C00B4EC41 /* GLKit.framework */, 84 | 3DDEFCA9159B640C00B4EC41 /* OpenGLES.framework */, 85 | ); 86 | name = Frameworks; 87 | sourceTree = ""; 88 | }; 89 | 3DDEFCAB159B640C00B4EC41 /* simpleFBO */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 3DDEFCB4159B640C00B4EC41 /* AppDelegate.h */, 93 | 3DDEFCB5159B640C00B4EC41 /* AppDelegate.m */, 94 | 3DDEFCB7159B640C00B4EC41 /* MainStoryboard.storyboard */, 95 | 3DDEFCBA159B640C00B4EC41 /* Shader.fsh */, 96 | 3DDEFCBC159B640C00B4EC41 /* Shader.vsh */, 97 | 3DDEFCBE159B640C00B4EC41 /* ViewController.h */, 98 | 3DDEFCBF159B640C00B4EC41 /* ViewController.m */, 99 | 3DDEFCAC159B640C00B4EC41 /* Supporting Files */, 100 | ); 101 | path = simpleFBO; 102 | sourceTree = ""; 103 | }; 104 | 3DDEFCAC159B640C00B4EC41 /* Supporting Files */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 3DDEFCAD159B640C00B4EC41 /* simpleFBO-Info.plist */, 108 | 3DDEFCAE159B640C00B4EC41 /* InfoPlist.strings */, 109 | 3DDEFCB1159B640C00B4EC41 /* main.m */, 110 | 3DDEFCB3159B640C00B4EC41 /* simpleFBO-Prefix.pch */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | /* End PBXGroup section */ 116 | 117 | /* Begin PBXNativeTarget section */ 118 | 3DDEFC9C159B640C00B4EC41 /* simpleFBO */ = { 119 | isa = PBXNativeTarget; 120 | buildConfigurationList = 3DDEFCC3159B640C00B4EC41 /* Build configuration list for PBXNativeTarget "simpleFBO" */; 121 | buildPhases = ( 122 | 3DDEFC99159B640C00B4EC41 /* Sources */, 123 | 3DDEFC9A159B640C00B4EC41 /* Frameworks */, 124 | 3DDEFC9B159B640C00B4EC41 /* Resources */, 125 | ); 126 | buildRules = ( 127 | ); 128 | dependencies = ( 129 | ); 130 | name = simpleFBO; 131 | productName = simpleFBO; 132 | productReference = 3DDEFC9D159B640C00B4EC41 /* simpleFBO.app */; 133 | productType = "com.apple.product-type.application"; 134 | }; 135 | /* End PBXNativeTarget section */ 136 | 137 | /* Begin PBXProject section */ 138 | 3DDEFC94159B640C00B4EC41 /* Project object */ = { 139 | isa = PBXProject; 140 | attributes = { 141 | LastUpgradeCheck = 0430; 142 | }; 143 | buildConfigurationList = 3DDEFC97159B640C00B4EC41 /* Build configuration list for PBXProject "simpleFBO" */; 144 | compatibilityVersion = "Xcode 3.2"; 145 | developmentRegion = English; 146 | hasScannedForEncodings = 0; 147 | knownRegions = ( 148 | en, 149 | ); 150 | mainGroup = 3DDEFC92159B640C00B4EC41; 151 | productRefGroup = 3DDEFC9E159B640C00B4EC41 /* Products */; 152 | projectDirPath = ""; 153 | projectRoot = ""; 154 | targets = ( 155 | 3DDEFC9C159B640C00B4EC41 /* simpleFBO */, 156 | ); 157 | }; 158 | /* End PBXProject section */ 159 | 160 | /* Begin PBXResourcesBuildPhase section */ 161 | 3DDEFC9B159B640C00B4EC41 /* Resources */ = { 162 | isa = PBXResourcesBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | 3DDEFCB0159B640C00B4EC41 /* InfoPlist.strings in Resources */, 166 | 3DDEFCB9159B640C00B4EC41 /* MainStoryboard.storyboard in Resources */, 167 | 3DDEFCBB159B640C00B4EC41 /* Shader.fsh in Resources */, 168 | 3DDEFCBD159B640C00B4EC41 /* Shader.vsh in Resources */, 169 | ); 170 | runOnlyForDeploymentPostprocessing = 0; 171 | }; 172 | /* End PBXResourcesBuildPhase section */ 173 | 174 | /* Begin PBXSourcesBuildPhase section */ 175 | 3DDEFC99159B640C00B4EC41 /* Sources */ = { 176 | isa = PBXSourcesBuildPhase; 177 | buildActionMask = 2147483647; 178 | files = ( 179 | 3DDEFCB2159B640C00B4EC41 /* main.m in Sources */, 180 | 3DDEFCB6159B640C00B4EC41 /* AppDelegate.m in Sources */, 181 | 3DDEFCC0159B640C00B4EC41 /* ViewController.m in Sources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXSourcesBuildPhase section */ 186 | 187 | /* Begin PBXVariantGroup section */ 188 | 3DDEFCAE159B640C00B4EC41 /* InfoPlist.strings */ = { 189 | isa = PBXVariantGroup; 190 | children = ( 191 | 3DDEFCAF159B640C00B4EC41 /* en */, 192 | ); 193 | name = InfoPlist.strings; 194 | sourceTree = ""; 195 | }; 196 | 3DDEFCB7159B640C00B4EC41 /* MainStoryboard.storyboard */ = { 197 | isa = PBXVariantGroup; 198 | children = ( 199 | 3DDEFCB8159B640C00B4EC41 /* en */, 200 | ); 201 | name = MainStoryboard.storyboard; 202 | sourceTree = ""; 203 | }; 204 | /* End PBXVariantGroup section */ 205 | 206 | /* Begin XCBuildConfiguration section */ 207 | 3DDEFCC1159B640C00B4EC41 /* Debug */ = { 208 | isa = XCBuildConfiguration; 209 | buildSettings = { 210 | ALWAYS_SEARCH_USER_PATHS = NO; 211 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 212 | CLANG_ENABLE_OBJC_ARC = YES; 213 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 214 | COPY_PHASE_STRIP = NO; 215 | GCC_C_LANGUAGE_STANDARD = gnu99; 216 | GCC_DYNAMIC_NO_PIC = NO; 217 | GCC_OPTIMIZATION_LEVEL = 0; 218 | GCC_PREPROCESSOR_DEFINITIONS = ( 219 | "DEBUG=1", 220 | "$(inherited)", 221 | ); 222 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 223 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 224 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 225 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 226 | GCC_WARN_UNUSED_VARIABLE = YES; 227 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 228 | SDKROOT = iphoneos; 229 | TARGETED_DEVICE_FAMILY = 2; 230 | }; 231 | name = Debug; 232 | }; 233 | 3DDEFCC2159B640C00B4EC41 /* Release */ = { 234 | isa = XCBuildConfiguration; 235 | buildSettings = { 236 | ALWAYS_SEARCH_USER_PATHS = NO; 237 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 238 | CLANG_ENABLE_OBJC_ARC = YES; 239 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 240 | COPY_PHASE_STRIP = YES; 241 | GCC_C_LANGUAGE_STANDARD = gnu99; 242 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 243 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 244 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 245 | GCC_WARN_UNUSED_VARIABLE = YES; 246 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 247 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 248 | SDKROOT = iphoneos; 249 | TARGETED_DEVICE_FAMILY = 2; 250 | VALIDATE_PRODUCT = YES; 251 | }; 252 | name = Release; 253 | }; 254 | 3DDEFCC4159B640C00B4EC41 /* Debug */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 258 | GCC_PREFIX_HEADER = "simpleFBO/simpleFBO-Prefix.pch"; 259 | "GCC_THUMB_SUPPORT[arch=armv6]" = ""; 260 | INFOPLIST_FILE = "simpleFBO/simpleFBO-Info.plist"; 261 | PRODUCT_NAME = "$(TARGET_NAME)"; 262 | WRAPPER_EXTENSION = app; 263 | }; 264 | name = Debug; 265 | }; 266 | 3DDEFCC5159B640C00B4EC41 /* Release */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 270 | GCC_PREFIX_HEADER = "simpleFBO/simpleFBO-Prefix.pch"; 271 | "GCC_THUMB_SUPPORT[arch=armv6]" = ""; 272 | INFOPLIST_FILE = "simpleFBO/simpleFBO-Info.plist"; 273 | PRODUCT_NAME = "$(TARGET_NAME)"; 274 | WRAPPER_EXTENSION = app; 275 | }; 276 | name = Release; 277 | }; 278 | /* End XCBuildConfiguration section */ 279 | 280 | /* Begin XCConfigurationList section */ 281 | 3DDEFC97159B640C00B4EC41 /* Build configuration list for PBXProject "simpleFBO" */ = { 282 | isa = XCConfigurationList; 283 | buildConfigurations = ( 284 | 3DDEFCC1159B640C00B4EC41 /* Debug */, 285 | 3DDEFCC2159B640C00B4EC41 /* Release */, 286 | ); 287 | defaultConfigurationIsVisible = 0; 288 | defaultConfigurationName = Release; 289 | }; 290 | 3DDEFCC3159B640C00B4EC41 /* Build configuration list for PBXNativeTarget "simpleFBO" */ = { 291 | isa = XCConfigurationList; 292 | buildConfigurations = ( 293 | 3DDEFCC4159B640C00B4EC41 /* Debug */, 294 | 3DDEFCC5159B640C00B4EC41 /* Release */, 295 | ); 296 | defaultConfigurationIsVisible = 0; 297 | }; 298 | /* End XCConfigurationList section */ 299 | }; 300 | rootObject = 3DDEFC94159B640C00B4EC41 /* Project object */; 301 | } 302 | --------------------------------------------------------------------------------