mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Prevent redundant glBindBuffer calls.
--HG-- branch : minor
This commit is contained in:
@@ -137,6 +137,7 @@ void ParticleSystem::draw(const Matrix4 &m)
|
||||
|
||||
gl.useVertexAttribArrays(ATTRIBFLAG_POS | ATTRIBFLAG_TEXCOORD | ATTRIBFLAG_COLOR);
|
||||
|
||||
gl.bindBuffer(BUFFER_VERTEX, 0);
|
||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Vertex), &particleVerts[0].r);
|
||||
glVertexAttribPointer(ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), &particleVerts[0].x);
|
||||
glVertexAttribPointer(ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), &particleVerts[0].s);
|
||||
@@ -148,6 +149,7 @@ void ParticleSystem::draw(const Matrix4 &m)
|
||||
// at least one graphics driver (the one for Kepler nvidia GPUs in OS X
|
||||
// 10.11) fails to render geometry if an index buffer is used with
|
||||
// client-side vertex arrays.
|
||||
gl.bindBuffer(BUFFER_INDEX, 0);
|
||||
gl.drawElements(GL_TRIANGLES, count, gltype, quadIndices.getIndices(0));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user