Fix compile failed on mobile platform

This commit is contained in:
肖峰 2015-11-27 15:19:50 +08:00
parent ec1d76b15e
commit 8b631f5c9f
1 changed files with 5 additions and 0 deletions

View File

@ -399,11 +399,14 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags)
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords));
}
#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
// GL_MULTISAMPLE & GL_LINE_SMOOTH only work on PC platform
if (this->_lineSmoothEnable == false)
{
glDisable(GL_MULTISAMPLE);
glDisable(GL_LINE_SMOOTH);
}
#endif
glLineWidth(_lineWidth);
glDrawArrays(GL_LINES, 0, _bufferCountGLLine);
@ -416,8 +419,10 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags)
glBindBuffer(GL_ARRAY_BUFFER, 0);
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLLine);
#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
if (this->_lineSmoothEnable == true)
glEnable(GL_MULTISAMPLE);
#endif
CHECK_GL_ERROR_DEBUG();
}