Example #1
0
void GLController::_BindAllTextures()
{
    // We always want to finish at texture 0, activating it last
    for (uint i = mNextTex.GetSize(); i > 0; )
    {
        mNextTU = --i;
        GLTexture* tex = mNextTex[mNextTU];
        if (tex != 0) tex->Activate();
        else _BindTexture(0, 0);
    }

    // Ensure that texture 0 is active
    if (mActiveTU != 0)
    {
        mActiveTU = 0;
        glActiveTexture(GL_TEXTURE0);
        glClientActiveTexture(GL_TEXTURE0);
    }
}