reset _VAOname to 0 before recreating on android

This commit is contained in:
Huabing.Xu 2015-01-06 09:44:19 +08:00
parent a1654e5714
commit 7f61a3d97b
1 changed files with 3 additions and 0 deletions

View File

@ -513,9 +513,12 @@ void ParticleSystemQuad::setupVBO()
void ParticleSystemQuad::listenRendererRecreated(EventCustom* event) void ParticleSystemQuad::listenRendererRecreated(EventCustom* event)
{ {
//when comes to foreground in android, _buffersVBO and _VAOname is a wild handle
//before recreating, we need to reset them to 0
memset(_buffersVBO, 0, sizeof(_buffersVBO)); memset(_buffersVBO, 0, sizeof(_buffersVBO));
if (Configuration::getInstance()->supportsShareableVAO()) if (Configuration::getInstance()->supportsShareableVAO())
{ {
_VAOname = 0;
setupVBOandVAO(); setupVBOandVAO();
} }
else else