WebGL Render Bug Fix

This commit is contained in:
Mat Groves 2013-06-24 15:32:52 +01:00
parent 953a19ff5c
commit c6e6f7458e
36 changed files with 729 additions and 340 deletions

View file

@ -660,6 +660,7 @@ PIXI.WebGLBatch.prototype.update = function()
*/
PIXI.WebGLBatch.prototype.render = function(start, end)
{
// console.log(start + " :: " + end + " : " + this.size);
start = start || 0;
//end = end || this.size;
@ -672,6 +673,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
}
if (this.size == 0)return;
this.update();
@ -688,7 +690,6 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
// ok..
gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
// update the uvs
gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
@ -722,7 +723,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
var len = end - start;
// console.log(this.size)
// DRAW THAT this!
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
}