OpenGL ES crash on move background, iOS 5.1

前端 未结 3 1396
刺人心
刺人心 2020-12-29 10:24

I have a little issue about my application iOS. When i\'m using the iOS simulator 5.1 ipad/iphone the application is working, but when i use a real iOS device (iPad and iPho

相关标签:
3条回答
  • 2020-12-29 10:30

    Check if you have the FPS node on the screen, it might be rendering..

    *edit - and check for audio playing

    0 讨论(0)
  • 2020-12-29 10:45

    Technically, the last method you can make OpenGL calls from is this one:

    - (void)applicationDidEnterBackground:(UIApplication *)application
    

    Although it is often a good idea to suspend drawing after applicationWillResignActive, this is just a recommendation and some apps have requirements beyond this. What is actually enforced is that you cannot make any OpenGL calls once your app moves to the background.

    From the docs:

    Once your application exits its applicationDidEnterBackground: method, it must not make any new OpenGL ES calls. If your application makes an OpenGL ES call, it is terminated by iOS.

    Also, remember to include glFinish() as your final GL call.

    0 讨论(0)
  • 2020-12-29 10:50

    In iOS 5.1 it is enforced that you cannot make a call to OpenGL after you have been requested to resign active.

    - (void)applicationWillResignActive:(UIApplication *)application
    

    Is the place to stop everything, whether it be a CADisplayLink or a [[CCDirector sharedDirector] stopAnimation]

    0 讨论(0)
提交回复
热议问题