glReadPixel停止使用iOS6 Beta [重复](glReadPixel stopped working with iOS6 Beta [duplicate])

编程入门 行业动态 更新时间:2024-10-26 06:35:49
glReadPixel停止使用iOS6 Beta [重复](glReadPixel stopped working with iOS6 Beta [duplicate])

可能重复: 为什么glReadPixels()在iOS 6.0中的代码中失败?

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

有没有人有一个想法出了什么问题或如何解决?

非常感谢您的帮助!

Possible Duplicate: Why is glReadPixels() failing in this code in iOS 6.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?

Your help is much appreciated!

最满意答案

对EAGLView.m进行更改会为我运行!

- (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.

更多推荐

本文发布于:2023-08-01 00:26:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1350516.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:停止使用   glReadPixel   Beta   duplicate   working

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!