1

Possible Duplicate:
Why is glReadPixels() failing in this code in iOS 6.0?

We're trying to take a snapshot of OpenGL ES view and to save the result in a UIImage.

For iOS 5.x our function works well.

For iOS 6 our function works only on the simulator and not on the device. We receive a blank (white) image on the device.

We referred to the technical report at http://developer.apple.com/library/ios/#qa/qa1704/_index.html and our function is almost identical to the function presented by apple in this technical report

Enclosed below is our function (in the Additional Details window).

We would be grateful to receive an assistance and we hope to have a reply as soon as possible since our app is currently online with this critical bug. (BTW, we use only opengl es and not cocos2d)

PLEASE HELP.

Community
  • 1
  • 1
  • Is there any error thrown by glGetError() after GLReadPixels call? If not, could you check if the raw image buffer after this call is unchanged? If it is empty, could you check if current GL context is same as the one that is drawing? Is the call on the same thread as the drawing pipeline?... – Matic Oblak Sep 24 '12 at 11:27

1 Answers1

2

In case you didn't get an answer on this: As documented in some other posts, I found that this only affected devices and not the emulator running my app. I set CAEAGLLayer drawableProperties when initializing with kEAGLDrawablePropertyRetainedBacking set true. Haven't noticed a huge hit in speed and my captures are working again.

Nostradamus
  • 1,497
  • 3
  • 20
  • 34