message: Set bound texture size on context change
diff: @@ -22,26 +22,7 @@ export default class TextureSystem extends System
  * @member {PIXI.BaseTexture[]}
  * @readonly
  */
  - this.boundTextures = [
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - null,
  - ];
  -
  + this.boundTextures = [];
  /**
  * Current location
  * @member {number}
  @@ -68,6 +49,15 @@ export default class TextureSystem extends System
  this.CONTEXT_UID = this.renderer.CONTEXT_UID;
  + const maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);
  +
  + this.boundTextures.length = maxTextures;
  +
  + for (let i = 0; i < maxTextures; i++)
  + {
  + this.boundTextures[i] = null;
  + }
  +
  // TODO move this.. to a nice make empty textures class..
  this.emptyTextures = {};
  @@ -81,9 +71,7 @@ export default class TextureSystem extends System
  gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.emptyTextures[gl.TEXTURE_CUBE_MAP].texture);
  - let i;
  -
  - for (i = 0; i < 6; i++)
  + for (let i = 0; i < 6; i++)
  {
  gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
  }
  @@ -91,7 +79,7 @@ export default class TextureSystem extends System
  gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
  gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
  - for (i = 0; i < this.boundTextures.length; i++)
  + for (let i = 0; i < this.boundTextures.length; i++)
  {
  this.bind(null, i);
  }
  