Giter VIP home page Giter VIP logo

coco2d-x-sourcecode-analysis's Introduction

coco2d-x-sourcecode-analysis's People

Contributors

sric0880 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coco2d-x-sourcecode-analysis's Issues

RenderTexture 源码解析 有一段小错误

//Sprite估计没有儿子节点,visit在这里没用 _sprite->visit(renderer, _modelViewTransform, flags);
个人认为这里是有用的,并不是渲染儿子节点而是渲染自身。在RenderTexture::initWithWidthAndHeight这个函数里面都是走的openGL方法,直接会把缓冲区渲染到sprite里面。
// 将纹理转换成Sprite setSprite(Sprite::createWithTexture(_texture));

///所有儿子节点的绘制最终都会反映在_sprite上,通过正常绘制_sprite即可 void RenderTexture::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
个人认为所有儿子节点的绘制最终都会反映在_sprite上这条注释不怎么正确,这段代码就是走正常的draw流程,只是会先绘制rendertexture里面的内容.
if (child != _sprite)//这里只绘制除_sprite之外的节点 child->visit(renderer, transform, flags);
这里会把_sprite剔除,是因为//Sprite估计没有儿子节点,visit在这里没用 _sprite->visit(renderer, _modelViewTransform, flags); draw(renderer, _modelViewTransform, flags);这上面已经渲染了。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.