From ace9933d72aa1c3574418ab50af8c009cefcbde8 Mon Sep 17 00:00:00 2001 From: huangshiwu Date: Fri, 7 Nov 2014 10:05:29 +0800 Subject: [PATCH] fix ui crash bug caused by DrawNode --- cocos/2d/CCDrawNode.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 3edbe0bbac..7093a6b4e5 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -348,6 +348,7 @@ void DrawNode::onDraw(const Mat4 &transform, uint32_t flags) } glDrawArrays(GL_TRIANGLES, 0, _bufferCount); + glBindBuffer(GL_ARRAY_BUFFER, 0); CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _bufferCount); CHECK_GL_ERROR_DEBUG(); @@ -382,6 +383,7 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) } glLineWidth(2); glDrawArrays(GL_LINES, 0, _bufferCountGLLine); + glBindBuffer(GL_ARRAY_BUFFER, 0); CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLLine); CHECK_GL_ERROR_DEBUG(); @@ -418,6 +420,7 @@ void DrawNode::onDrawGLPoint(const Mat4 &transform, uint32_t flags) } glDrawArrays(GL_POINTS, 0, _bufferCountGLPoint); + glBindBuffer(GL_ARRAY_BUFFER, 0); CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLPoint); CHECK_GL_ERROR_DEBUG();