diff --git a/spine-cocos2d-iphone/2/src/spine/PolygonBatch.m b/spine-cocos2d-iphone/2/src/spine/PolygonBatch.m index 7befe98db..8bfb21f2c 100644 --- a/spine-cocos2d-iphone/2/src/spine/PolygonBatch.m +++ b/spine-cocos2d-iphone/2/src/spine/PolygonBatch.m @@ -87,7 +87,6 @@ - (void) flush { if (!_verticesCount) return; - ccGLBindVAO(0); ccGLBindTexture2D(_texture.name); glEnableVertexAttribArray(kCCVertexAttrib_Position); glEnableVertexAttribArray(kCCVertexAttrib_Color); diff --git a/spine-cocos2d-iphone/2/src/spine/SkeletonRenderer.m b/spine-cocos2d-iphone/2/src/spine/SkeletonRenderer.m index 01013f873..2960abe04 100644 --- a/spine-cocos2d-iphone/2/src/spine/SkeletonRenderer.m +++ b/spine-cocos2d-iphone/2/src/spine/SkeletonRenderer.m @@ -134,6 +134,7 @@ static const int quadTriangles[6] = {0, 1, 2, 2, 3, 0}; - (void) draw { CC_NODE_DRAW_SETUP(); + ccGLBindVAO(0); ccColor3B nodeColor = self.color; _skeleton->r = nodeColor.r / (float)255; diff --git a/spine-cocos2d-iphone/3.0/src/spine/PolygonBatch.m b/spine-cocos2d-iphone/3.0/src/spine/PolygonBatch.m index 8301002c1..7e8869706 100644 --- a/spine-cocos2d-iphone/3.0/src/spine/PolygonBatch.m +++ b/spine-cocos2d-iphone/3.0/src/spine/PolygonBatch.m @@ -88,7 +88,6 @@ - (void) flush { if (!_verticesCount) return; - ccGLBindVAO(0); ccGLBindTexture2D(_texture.name); glEnableVertexAttribArray(kCCVertexAttrib_Position); glEnableVertexAttribArray(kCCVertexAttrib_Color); diff --git a/spine-cocos2d-iphone/3.0/src/spine/SkeletonRenderer.m b/spine-cocos2d-iphone/3.0/src/spine/SkeletonRenderer.m index 130355b84..27210e5cb 100644 --- a/spine-cocos2d-iphone/3.0/src/spine/SkeletonRenderer.m +++ b/spine-cocos2d-iphone/3.0/src/spine/SkeletonRenderer.m @@ -135,6 +135,7 @@ static const int quadTriangles[6] = {0, 1, 2, 2, 3, 0}; - (void) draw { CC_NODE_DRAW_SETUP(); + ccGLBindVAO(0); CCColor* nodeColor = self.color; _skeleton->r = nodeColor.red; diff --git a/spine-cocos2dx/2/src/spine/PolygonBatch.cpp b/spine-cocos2dx/2/src/spine/PolygonBatch.cpp index 58c659bd4..cf86dd9b5 100644 --- a/spine-cocos2dx/2/src/spine/PolygonBatch.cpp +++ b/spine-cocos2dx/2/src/spine/PolygonBatch.cpp @@ -93,7 +93,6 @@ void PolygonBatch::add (CCTexture2D* addTexture, void PolygonBatch::flush () { if (!verticesCount) return; - ccGLBindVAO(0); ccGLBindTexture2D(texture->getName()); glEnableVertexAttribArray(kCCVertexAttrib_Position); glEnableVertexAttribArray(kCCVertexAttrib_Color); diff --git a/spine-cocos2dx/2/src/spine/SkeletonRenderer.cpp b/spine-cocos2dx/2/src/spine/SkeletonRenderer.cpp index 934c32238..704f6d6f9 100644 --- a/spine-cocos2dx/2/src/spine/SkeletonRenderer.cpp +++ b/spine-cocos2dx/2/src/spine/SkeletonRenderer.cpp @@ -136,6 +136,7 @@ void SkeletonRenderer::update (float deltaTime) { void SkeletonRenderer::draw () { CC_NODE_DRAW_SETUP(); + ccGLBindVAO(0); ccColor3B nodeColor = getColor(); skeleton->r = nodeColor.r / (float)255; diff --git a/spine-cocos2dx/3.0/src/spine/PolygonBatch.cpp b/spine-cocos2dx/3.0/src/spine/PolygonBatch.cpp index 1309dfe4f..a8a227873 100644 --- a/spine-cocos2dx/3.0/src/spine/PolygonBatch.cpp +++ b/spine-cocos2dx/3.0/src/spine/PolygonBatch.cpp @@ -93,7 +93,6 @@ void PolygonBatch::add (const Texture2D* addTexture, void PolygonBatch::flush () { if (!verticesCount) return; - GL::bindVAO(0); GL::bindTexture2D(texture->getName()); glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); diff --git a/spine-cocos2dx/3.0/src/spine/SkeletonRenderer.cpp b/spine-cocos2dx/3.0/src/spine/SkeletonRenderer.cpp index 4bcc9156f..a921bbb8b 100644 --- a/spine-cocos2dx/3.0/src/spine/SkeletonRenderer.cpp +++ b/spine-cocos2dx/3.0/src/spine/SkeletonRenderer.cpp @@ -142,6 +142,7 @@ void SkeletonRenderer::draw(Renderer* renderer, const kmMat4& transform, bool tr void SkeletonRenderer::drawSkeleton (const kmMat4& transform, bool transformUpdated) { getShaderProgram()->use(); getShaderProgram()->setUniformsForBuiltins(transform); + GL::bindVAO(0); Color3B nodeColor = getColor(); skeleton->r = nodeColor.r / (float)255; diff --git a/spine-cocos2dx/3.1/src/spine/SkeletonRenderer.cpp b/spine-cocos2dx/3.1/src/spine/SkeletonRenderer.cpp index c79c3ebde..3ad004d54 100644 --- a/spine-cocos2dx/3.1/src/spine/SkeletonRenderer.cpp +++ b/spine-cocos2dx/3.1/src/spine/SkeletonRenderer.cpp @@ -142,6 +142,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Matrix& transform, bool t void SkeletonRenderer::drawSkeleton (const Matrix &transform, bool transformUpdated) { getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); + GL::bindVAO(0); Color3B nodeColor = getColor(); skeleton->r = nodeColor.r / (float)255;