More client side buffer fixes.

This commit is contained in:
James Gregory 2013-04-08 21:08:34 -07:00
parent 91ea64db09
commit 8a9586fd9d
2 changed files with 17 additions and 0 deletions

View File

@ -338,6 +338,7 @@ void CCMotionStreak::draw()
ccGLBindTexture2D( m_pTexture->getName() );
#ifdef EMSCRIPTEN
// Size calculations from ::initWithFade
setGLBufferData(m_pVertices, (sizeof(ccVertex2F) * m_uMaxPoints * 2), 0);
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);

View File

@ -488,8 +488,16 @@ void CCTexture2D::drawAtPoint(const CCPoint& point)
ccGLBindTexture2D( m_uName );
#ifdef EMSCRIPTEN
setGLBufferData(vertices, 8 * sizeof(GLfloat), 0);
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
setGLBufferData(coordinates, 8 * sizeof(GLfloat), 1);
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, 0);
#else
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, coordinates);
#endif // EMSCRIPTEN
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
@ -513,8 +521,16 @@ void CCTexture2D::drawInRect(const CCRect& rect)
ccGLBindTexture2D( m_uName );
#ifdef EMSCRIPTEN
setGLBufferData(vertices, 8 * sizeof(GLfloat), 0);
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
setGLBufferData(coordinates, 8 * sizeof(GLfloat), 1);
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, 0);
#else
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, coordinates);
#endif // EMSCRIPTEN
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}