Black textures on Android after resuming from sleep (texture cache not re-generating mipmaps after GL context is lost + quickFIX)

I recently discovered an issue on Android - if you use mipmapped textures and you loose the GL context (e.g. put your phone to sleep), the CCTextureCache doesn’t generate the mipmaps when reloading all the textures, which basicaly means all your mimpapped textures become black.

I have fixed this by adding this line at the end of the VolatileTexture::reloadAllTextures() method in CCTextureCache.cpp:

    ...
    vt->texture->setTexParameters(&vt->m_texParams);
    if (vt->m_texParams.minFilter == GL_LINEAR_MIPMAP_LINEAR || vt->m_texParams.magFilter == GL_LINEAR_MIPMAP_LINEAR ) vt->texture->generateMipmap();
    ...

You should probably check for more possible filters etc. but this worked for me.

thank you:)