谢绝转载,若有疑问,请联系[email protected]
sric0880 / coco2d-x-sourcecode-analysis Goto Github PK
View Code? Open in Web Editor NEWcoco2d-x 3.2源码分析
coco2d-x 3.2源码分析
谢绝转载,若有疑问,请联系[email protected]
//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);
这上面已经渲染了。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.