Skip to content

Instantly share code, notes, and snippets.

@mootoh
Created June 2, 2014 05:34
Show Gist options
  • Save mootoh/f5db6f11c4167476a758 to your computer and use it in GitHub Desktop.
Save mootoh/f5db6f11c4167476a758 to your computer and use it in GitHub Desktop.
cocos2d drawScene
Director::drawScene
Scene(Node)::visit
matrix transform
push & set model_view matrix to it
sort all children
for child in children whose zOrder < 0:
child.visit
Node::draw
for child in children whose zOrder >= 0:
child.visit
pop model_view matrix
Renderer::render
renderqueue.sort
visitRenderQueue
for each cmd in queue
exec cmd by its type
flush
drawBatchedQuads
draw polygons to GL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment