I’m very interested in how cocos2d-iphone works. cocos2d refresh the screen 60 times per second by default, is there a single “drawing thread” responsible for drawing all CCNode on the screen? and another “main thread” responsible for dealting with user input events?
I’m very interested in how cocos2d-iphone works. cocos2d refresh the screen 60 times per
Share
Cocos2d has a main loop driven by CADisplayLink. It updates (visits) every node once per frame.
User input events come in from the iOS SDK at any time and will be received by CCGLView. They’re then dispatched to the touch delegates.
Cocos2D does not use threads by default, and there are very few options in that area. Specifically you can change the Mac OS X version to run a second thread for all OpenGL stuff, but it is marked experimental.