MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / newRenderPair

Method newRenderPair

Source/Node/Node.cpp:1651–1661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1649}
1650
1651Node::Grabber::RenderPair Node::Grabber::newRenderPair(float width, float height) {
1652 auto renderTarget = RenderTarget::create(
1653 s_cast<uint16_t>(width),
1654 s_cast<uint16_t>(height));
1655 auto surface = Sprite::create(renderTarget->getTexture());
1656 surface->setAsManaged();
1657 surface->setPosition({width / 2.0f, height / 2.0f});
1658 surface->setBlendFunc({BlendFunc::One, BlendFunc::Zero});
1659 surface->setEffect(SpriteEffect::create());
1660 return {MakeRef(renderTarget), MakeRef(surface)};
1661}
1662
1663void Node::Grabber::grab(Node* target) {
1664 float width = std::floor(target->getWidth()); // init RT with integer size

Callers

nothing calls this directly

Calls 7

MakeRefFunction · 0.85
setAsManagedMethod · 0.80
createFunction · 0.50
getTextureMethod · 0.45
setPositionMethod · 0.45
setBlendFuncMethod · 0.45
setEffectMethod · 0.45

Tested by

no test coverage detected