Multi-threading final toughts & Loading screen
mer., mai 27, 2009 at 7:19 Well.. So I implemented the operation queue and it's indeed very easy to use BUT.. actually not useful for me.
My goal was to parallelize the pre-loading of textures while keeping the cocos2D rendering loop active so the UI wont seems "frozen".
However, in my particular case, I was creating textures while the main thread was living his own life.
So when I would add a texture, the cocos2D OpenGL loop might not be in the correct state and the app might crash "randomly".
I tried another solution with loading "steps": load some files, wait, load some other files... But the loading screen would lock up, animate, lock up, animate etc.. Not satisfying.
What I need was another rendering thread.. So I ended up by mixing UIKit (wich has his own rendering thread) and Cocos, just for the loading screen: my loading scene has now an UIActivityIndicatorView until the loading has completed. It looks very nice and polished, but take a look yourself :)

Fraggle |
4 Comments |
cocos2d,
performance,
ui in
iphone, obj-c & cocoa 
