Skip to content

Instantly share code, notes, and snippets.

@beugnen
Created May 20, 2012 00:16
Show Gist options
  • Save beugnen/2732940 to your computer and use it in GitHub Desktop.
Save beugnen/2732940 to your computer and use it in GitHub Desktop.
iOS OpenGL ES 2 Creating Secondary Framebuffer
...MyDualFramebufferView _myView;
- (void)viewWillLayoutSubviews
{
CGRect rc = self.view.bounds;
GLfloat scale=1;
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
{
scale = [[UIScreen mainScreen] scale] ;
}
_myView->Resize (rc.size.width, rc.size.height, scale); // myView is anything you like
[((GLKView *) self.view) bindDrawable]; // reset to main framebuffer because we changed it when we made a 2nd framebuffer
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment