fix on settexture2D

This commit is contained in:
Felipe Alfonso 2017-01-20 15:51:00 -03:00
parent c40e94f15b
commit c37c69e312

View file

@ -152,7 +152,11 @@ WebGLRenderer.prototype = {
{ {
if (this.currentTexture2D != texture2D) if (this.currentTexture2D != texture2D)
{ {
this.flush(); var batch = this.batch;
if (batch)
{
batch.flush();
}
gl.activeTexture(gl.TEXTURE0); gl.activeTexture(gl.TEXTURE0);
gl.bindTexture(gl.TEXTURE_2D, texture2D); gl.bindTexture(gl.TEXTURE_2D, texture2D);
this.currentTexture2D = texture2D; this.currentTexture2D = texture2D;