issue #1683: Fixed an issue about OPENGLES ERROR 501 Warning in CCTextureAtlas.cpp.

This commit is contained in:
James Chen 2013-01-26 14:20:24 +08:00
parent 3328cfd6a4
commit d9fd3c6c60
1 changed files with 3 additions and 3 deletions

View File

@ -603,7 +603,7 @@ void CCTextureAtlas::drawNumberOfQuads(unsigned int n, unsigned int start)
{ {
glBindBuffer(GL_ARRAY_BUFFER, m_pBuffersVBO[0]); glBindBuffer(GL_ARRAY_BUFFER, m_pBuffersVBO[0]);
// option 1: subdata // option 1: subdata
glBufferSubData(GL_ARRAY_BUFFER, sizeof(m_pQuads[0])*start, sizeof(m_pQuads[0]) * n , &m_pQuads[start] ); //glBufferSubData(GL_ARRAY_BUFFER, sizeof(m_pQuads[0])*start, sizeof(m_pQuads[0]) * n , &m_pQuads[start] );
// option 2: data // option 2: data
// glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * (n-start), &quads_[start], GL_DYNAMIC_DRAW); // glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * (n-start), &quads_[start], GL_DYNAMIC_DRAW);
@ -619,7 +619,7 @@ void CCTextureAtlas::drawNumberOfQuads(unsigned int n, unsigned int start)
m_bDirty = false; m_bDirty = false;
} }
glBindVertexArray(m_uVAOname); ccGLBindVAO(m_uVAOname);
#if CC_REBIND_INDICES_BUFFER #if CC_REBIND_INDICES_BUFFER
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_pBuffersVBO[1]); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_pBuffersVBO[1]);
@ -635,7 +635,7 @@ void CCTextureAtlas::drawNumberOfQuads(unsigned int n, unsigned int start)
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
#endif #endif
glBindVertexArray(0); // glBindVertexArray(0);
#else // ! CC_TEXTURE_ATLAS_USE_VAO #else // ! CC_TEXTURE_ATLAS_USE_VAO