1

I've been working on a game using the MapKit Framework and Cocos2D v2.0 library: I display a transparent OpenGL View (EAGLView) managed by Cocos2d above a MKMapView. It's a large project, more than a man-year so far for the iOS client alone.

To have a smooth and synchronized Cocos2d layer with the map pan and zoom, I enable the background thread switch in ccConfig.h (CC_DIRECTOR_IOS_USE_BACKGROUND_THREAD). Before the last iOS 6 update everything was fine. But in iOS 6, the app crashes in swapBuffers method of CCGLView causing a Bad Access here:

[context_ presentRenderbuffer:GL_RENDERBUFFER]

I'm wondering if it's related to multi threading and OpenGL. It only happens with the background switch on and the MKMapView.

I already tried with the map and without the background thread enable for cocos, I tried also cocos in background thread without the map, and no crashes.

Thanks,

JD C4M
  • 151
  • 1
  • 1
  • 6
  • Sounds like a threading issue. If I remember correctly, the threading flag carries a cautionary note, such as "heavily untested" or "use at own risk" or something similar. – CodeSmile Sep 20 '12 at 19:04
  • I'm trying to use sharegroup to avoid this kind of thread problem (I believe that the new ios6 map use OpenGL 2D/3D rendering), but I don't find anyway to get access to the EAGLContext of a MKMapView. – JD C4M Sep 21 '12 at 08:54

0 Answers0