I\'m trying to port Apples GLPaint example to use GLKit. Using a UIView, its possible to return the CAEAGLLayer of the view and set the drawableProperties to include kEAGLDrawab
If you want to get kEAGLDrawablePropertyRetainedBacking in a GLKView, add the following category to your project.
@interface CAEAGLLayer (Retained)
@end
@implementation CAEAGLLayer (Retained)
- (NSDictionary*) drawableProperties
{
return @{kEAGLDrawablePropertyRetainedBacking : @(YES)};
}
@end
Setting the drawableProperties on the CAEAGLLayer maintained by the GLKView doesn't work because the GLKView overwrites those properties when it binds its drawable and generates its render storage. Using this method forces the GLKView to use your category's returned drawableProperties instead.