Created
May 20, 2012 00:16
-
-
Save beugnen/2732940 to your computer and use it in GitHub Desktop.
iOS OpenGL ES 2 Creating Secondary Framebuffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...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