Cocos2d templates and the usual sample projects initialize cocos openGL ES view and other stuff in the applicationDidFinishLaunching / application:didFinishLaunchingWithOptions: method. In relation to the last method, Apple iOS Programming Guide states that:
"Apps that use OpenGL ES should not use this method to prepare their drawing environment. Instead, they should defer any OpenGL ES drawing calls to the applicationDidBecomeActive: method."
So, my question is, is application:didFinishLaunchingWithOptions: really the proper place to initialize cocos2d? or should we be doing that in applicationDidBecomeActive: ?
If you think that applicationDidBecomeActive: is the way to go, what would be the consequences in relation to background execution? i.e. what should we do to avoid a sort of double initialization when the app comes to foreground from being inactive?
Thanks in advance
Good question … so far 99.9% of all cocos2d apps do it the way cocos2d does it and I haven't heard of a single issue.
Since Apple doesn't really explain why this is particularly important for OpenGL ES apps, I would assume the following: