From 993e420ce4130fe9ca5fb9316f540842e3c74970 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Fri, 3 Jul 2015 11:30:38 +0800 Subject: [PATCH] Fix drawLine & drawPoints won't use blendFunc bug --- cocos/2d/CCDrawNode.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 2d04abb00f..c2b0b37b73 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -371,7 +371,9 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) auto glProgram = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR); glProgram->use(); glProgram->setUniformsForBuiltins(transform); - + + GL::blendFunc(_blendFunc.src, _blendFunc.dst); + if (_dirtyGLLine) { glBindBuffer(GL_ARRAY_BUFFER, _vboGLLine); @@ -412,7 +414,9 @@ void DrawNode::onDrawGLPoint(const Mat4 &transform, uint32_t flags) auto glProgram = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_COLOR_TEXASPOINTSIZE); glProgram->use(); glProgram->setUniformsForBuiltins(transform); - + + GL::blendFunc(_blendFunc.src, _blendFunc.dst); + if (_dirtyGLPoint) { glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint);