fix black screen when back to foreground on android.

This commit is contained in:
Dhilan007 2013-12-27 11:56:56 +08:00
parent beced4897e
commit f250d24766
2 changed files with 9 additions and 1 deletions

View File

@ -185,6 +185,11 @@ void ShaderCache::reloadDefaultShaders()
p->reset();
loadDefaultShader(p, kShaderType_PositionTextureColor);
// Position Texture Color without MVP shader
p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP);
p->reset();
loadDefaultShader(p, kShaderType_PositionTextureColor_noMVP);
// Position Texture Color alpha test
p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST);
p->reset();

View File

@ -65,11 +65,14 @@ Renderer::~Renderer()
glDeleteVertexArrays(1, &_quadVAO);
GL::bindVAO(0);
}
#if CC_ENABLE_CACHE_TEXTURE_DATA
NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND);
#endif
}
void Renderer::initGLView()
{
#if 0//CC_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
// listen the event when app go to background
NotificationCenter::getInstance()->addObserver(this,
callfuncO_selector(Renderer::onBackToForeground),