mirror of https://github.com/axmolengine/axmol.git
Fix the ordering of vertex attributes for CCProgressTimer.
This commit is contained in:
parent
7a30b0e446
commit
93238572df
|
@ -500,16 +500,16 @@ void CCProgressTimer::draw(void)
|
||||||
ccGLBindTexture2D( m_pSprite->getTexture()->getName() );
|
ccGLBindTexture2D( m_pSprite->getTexture()->getName() );
|
||||||
|
|
||||||
#ifdef EMSCRIPTEN
|
#ifdef EMSCRIPTEN
|
||||||
setGLBufferData(&m_pVertexData[0], (m_nVertexDataCount * sizeof(ccV2F_C4B_T2F)), 0);
|
setGLBufferData((void*) m_pVertexData, (m_nVertexDataCount * sizeof(ccV2F_C4B_T2F)), 0);
|
||||||
|
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
glVertexAttribPointer( kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(m_pVertexData[0]), (GLvoid*)offset);
|
glVertexAttribPointer( kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid*)offset);
|
||||||
|
|
||||||
offset += sizeof(ccVertex2F);
|
offset += sizeof(ccVertex2F);
|
||||||
glVertexAttribPointer( kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(m_pVertexData[0]), (GLvoid*)offset);
|
glVertexAttribPointer( kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ccV2F_C4B_T2F), (GLvoid*)offset);
|
||||||
|
|
||||||
offset += sizeof(ccColor4F);
|
offset += sizeof(ccColor4B);
|
||||||
glVertexAttribPointer( kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(m_pVertexData[0]), (GLvoid*)offset);
|
glVertexAttribPointer( kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid*)offset);
|
||||||
#else
|
#else
|
||||||
glVertexAttribPointer( kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(m_pVertexData[0]) , &m_pVertexData[0].vertices);
|
glVertexAttribPointer( kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(m_pVertexData[0]) , &m_pVertexData[0].vertices);
|
||||||
glVertexAttribPointer( kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(m_pVertexData[0]), &m_pVertexData[0].texCoords);
|
glVertexAttribPointer( kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(m_pVertexData[0]), &m_pVertexData[0].texCoords);
|
||||||
|
|
Loading…
Reference in New Issue