glReadPixel停止使用iOS6 Beta [英] glReadPixel stopped working with iOS6 Beta

查看:286
本文介绍了glReadPixel停止使用iOS6 Beta的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

我目前在Appstore中有一个使用Cocos2D框架的应用程序。对于碰撞检测我使用glReadPixels。屏幕只有白色和黑色像素,检测黑色像素意味着碰撞。一切工作正常到iOS 5.1.1,但在iOS6 Beta(所有)glReadPixels停止工作。现在,glReadPixels返回的RGB值总是为0,0,0。

I currently have an App in Appstore that uses the Cocos2D framework. For collision detection I am using glReadPixels. The screen only has white and black pixels and detecting a black pixel means collision. Everything works fine up to iOS 5.1.1 but in iOS6 Beta (all of them) glReadPixels stopped working. Now the RGB values returned by glReadPixels are always 0,0,0.

有没有人知道出了什么问题或者如何解决?

Does anyone have an idea what went wrong or how to fix that?

您的帮助非常感谢!

推荐答案

感谢苹果私人列表建议 - 我发现了这个问题的解决方案。

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

在Cocos2D类EAGLView.m中,我在init方法中将preserveBackbuffer变量设置为YES。它现在可以再次在iOS 6测试版。

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.

这篇关于glReadPixel停止使用iOS6 Beta的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆