mirror of https://github.com/axmolengine/axmol.git
More client side buffer fixes.
This commit is contained in:
parent
b9d3bfd545
commit
eca46e9bee
|
@ -338,6 +338,7 @@ void CCMotionStreak::draw()
|
||||||
ccGLBindTexture2D( m_pTexture->getName() );
|
ccGLBindTexture2D( m_pTexture->getName() );
|
||||||
|
|
||||||
#ifdef EMSCRIPTEN
|
#ifdef EMSCRIPTEN
|
||||||
|
// Size calculations from ::initWithFade
|
||||||
setGLBufferData(m_pVertices, (sizeof(ccVertex2F) * m_uMaxPoints * 2), 0);
|
setGLBufferData(m_pVertices, (sizeof(ccVertex2F) * m_uMaxPoints * 2), 0);
|
||||||
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
|
||||||
|
|
||||||
|
|
|
@ -488,8 +488,16 @@ void CCTexture2D::drawAtPoint(const CCPoint& point)
|
||||||
ccGLBindTexture2D( m_uName );
|
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_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
|
||||||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, coordinates);
|
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, coordinates);
|
||||||
|
#endif // EMSCRIPTEN
|
||||||
|
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||||
}
|
}
|
||||||
|
@ -513,8 +521,16 @@ void CCTexture2D::drawInRect(const CCRect& rect)
|
||||||
|
|
||||||
ccGLBindTexture2D( m_uName );
|
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_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
|
||||||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, coordinates);
|
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, coordinates);
|
||||||
|
#endif // EMSCRIPTEN
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue