シメオンの回答は機能しますが、アプリケーション内のすべてのEAGLベースのビューの動作が変更されます。
@interface RetainedEAGLLayer : CAEAGLLayer
@end
@implementation RetainedEAGLLayer
- (void)setDrawableProperties:(NSDictionary *)drawableProperties {
// Copy the dictionary and add/modify the retained property
NSMutableDictionary *mutableDictionary = [[NSMutableDictionary alloc] initWithCapacity:drawableProperties.count + 1];
[drawableProperties enumerateKeysAndObjectsUsingBlock:^(id key, id object, BOOL *stop) {
// Copy all keys except the retained backing
if (![key isKindOfClass:[NSString class]]
|| ![(NSString *)key isEqualToString:kEAGLDrawablePropertyRetainedBacking])
[mutableDictionary setObject:object forKey:key];
}];
// Add the retained backing setting
[mutableDictionary setObject:@(YES) forKey:kEAGLDrawablePropertyRetainedBacking];
// Continue
[super setDrawableProperties:mutableDictionary];
[mutableDictionary release];
}
@end
この
@interface RetainedGLKView : GLKView
@end
@implementation RetainedGLKView
+ (Class)layerClass {
return [RetainedEAGLLayer class];
}
@end
:このように、私はそうではない、いくつかの裏には強制的に必要な景色などを持っているので、私はGLKViewとCEAGLLayerのサブクラスを作成することによって、わずかに異なる解決策を考え出しました
これで、保持されているバッキングを強制したいビューに対して、GLKViewの代わりにRetainedGLKViewを使用できます。あなたのGLKView実装ファイルで
私は解決策はありませんが、保持されたバッキングモードが完全に狂っている網膜モードでは、新しいiPadにドライバのバグがあることに注意してください。ここでは議論と回避策があります:http://stackoverflow.com/questions/9753230/ipad-3-opengl-bug-with-keagldrawablepropertyrequired-back-and-retina –
デリゲートメソッドで描画していますか?あなたは明確なステップを使用していますか? – nielsbot
私は正直であることを覚えていません。私はちょうどCAEAGLLayerを使用して終了しましたが、行列の数学とテクスチャの読み込みにGLKitを使用しました。 – Brett