MCPcopy Create free account
hub / github.com/axmolengine/axmol / draw

Method draw

core/2d/ProgressTimer.cpp:630–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

628}
629
630void ProgressTimer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
631{
632 if (_vertexData.empty() || !_sprite)
633 return;
634
635 const ax::Mat4& projectionMat = _director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
636 Mat4 finalMat = projectionMat * transform;
637 _programState->setUniform(_locMVP1, finalMat.m, sizeof(finalMat.m));
638 _programState->setTexture(_locTex1, 0, _sprite->getTexture()->getBackendTexture());
639
640 if (_type == Type::BAR)
641 {
642 if (!_reverseDirection)
643 {
644 _customCommand.init(_globalZOrder, _sprite->getBlendFunc());
645 renderer->addCommand(&_customCommand);
646 }
647 else
648 {
649 _customCommand.init(_globalZOrder, _sprite->getBlendFunc());
650 renderer->addCommand(&_customCommand);
651
652 _customCommand2.init(_globalZOrder, _sprite->getBlendFunc());
653 _programState2->setUniform(_locMVP2, finalMat.m, sizeof(finalMat.m));
654 _programState2->setTexture(_locTex2, 0, _sprite->getTexture()->getBackendTexture());
655 renderer->addCommand(&_customCommand2);
656 }
657 }
658 else
659 {
660 _customCommand.init(_globalZOrder, _sprite->getBlendFunc());
661 renderer->addCommand(&_customCommand);
662 }
663}
664
665}

Callers

nothing calls this directly

Calls 7

getBackendTextureMethod · 0.80
emptyMethod · 0.45
setUniformMethod · 0.45
setTextureMethod · 0.45
getTextureMethod · 0.45
initMethod · 0.45
addCommandMethod · 0.45

Tested by

no test coverage detected