We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a500e7f commit 835fec0Copy full SHA for 835fec0
cocos/2d/CCParticleSystemQuad.cpp
@@ -545,10 +545,15 @@ void ParticleSystemQuad::setTotalParticles(int tp)
545
546
void ParticleSystemQuad::setupVBOandVAO()
547
{
548
- // clean VAO
549
glDeleteBuffers(2, &_buffersVBO[0]);
550
- glDeleteVertexArrays(1, &_VAOname);
551
- GL::bindVAO(0);
+
+ // clean VAO
+ if (_VAOname)
552
+ {
553
+ glDeleteVertexArrays(1, &_VAOname);
554
+ GL::bindVAO(0);
555
+ _VAOname = 0;
556
+ }
557
558
glGenVertexArrays(1, &_VAOname);
559
GL::bindVAO(_VAOname);
0 commit comments