glReadPixel stopped working with iOS6 Beta [duplicate]

…衆ロ難τιáo~ 提交于 2019-12-04 10:13:11
Javier

Changing this on EAGLView.m runs for me!

- (id)initWithCoder:(NSCoder*)coder {

   self = [super initWithCoder:coder];
   if (self) {
        CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;

        eaglLayer.opaque = TRUE;
        eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
                                        [NSNumber numberWithBool:YES],
                                        kEAGLDrawablePropertyRetainedBacking,
                                        kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat,
                                        nil];
        // YES
        self.contentScaleFactor = [UIScreen mainScreen].scale;
    }

    return self;
}

Thanks for the apple private list suggestion - that's where I found the solution to that problem.

In the Cocos2D Class "EAGLView.m" I was setting the "preserveBackbuffer" variable to "YES" at the init method. It now works again also in iOS 6 Beta.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!