Tidying up

This commit is contained in:
Richard Davey 2017-10-17 21:32:14 +01:00
parent f13043ee63
commit 4f1bd5a3eb

View file

@ -132,11 +132,13 @@ var ParticleRenderer = new Class({
}
this.bind(shader);
this.vertexBufferObject.updateResource(vertexDataBuffer.getUsedBufferAsFloat(), 0);
gl.drawElements(gl.TRIANGLES, this.elementCount, gl.UNSIGNED_SHORT, 0);
this.elementCount = 0;
vertexDataBuffer.clear();
if (renderTarget)
@ -213,6 +215,7 @@ var ParticleRenderer = new Class({
this.manager.setRenderer(this, emitter.frame.source.glTexture, renderTarget);
// If there are more particles than fit into a single batch (16000) then it flushes after each one
for (var batchIndex = 0; batchIndex < batchCount; ++batchIndex)
{
var batchSize = Math.min(length, CONST.MAX);