jeudi 8 juin 2017

Cost of Using Static variables c++

void Animation::playAnimation() const
{
    static const int index = 0;
    const std::string& animationFileName = m_animationContainer.getAnimationName(index);
    static const int zOrder = -1;
    static bool isLooping = false;

    AnimationBank::play(animationFileName,
                        zOrder,
                        isLooping);
}

what is an overhead of defining index, zOrder, isLooping as static

Aucun commentaire:

Enregistrer un commentaire