Skip to content

Commit e0c6a0c

Browse files
committed
Using createEmptyTexture again.
1 parent 57e1241 commit e0c6a0c

1 file changed

Lines changed: 3 additions & 25 deletions

File tree

src/renderer/webgl/WebGLRenderer.js

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -303,29 +303,9 @@ Phaser.Renderer.WebGL.prototype = {
303303
return;
304304
}
305305

306-
var gl = this.gl;
307-
308-
// var tempTexture = this.createEmptyTexture(1, 1, 0);
309-
310306
for (var i = 0; i < this.maxTextures; i++)
311307
{
312-
console.log('createMultiEmptyTextures', i);
313-
314-
var texture = gl.createTexture();
315-
316-
gl.activeTexture(gl.TEXTURE0 + i);
317-
gl.bindTexture(gl.TEXTURE_2D, texture);
318-
319-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
320-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
321-
322-
// We'll read from this texture, but it won't have mipmaps, so turn them off:
323-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
324-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
325-
326-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
327-
328-
this.textureArray[i] = texture;
308+
this.textureArray[i] = this.createEmptyTexture(1, 1, 0, i);
329309
}
330310
},
331311

@@ -831,16 +811,14 @@ Phaser.Renderer.WebGL.prototype = {
831811
return this;
832812
},
833813

834-
createEmptyTexture: function (width, height, scaleMode)
814+
createEmptyTexture: function (width, height, scaleMode, textureIndex)
835815
{
836-
console.log('createEmptyTexture - set as active on TEXTURE0');
837-
838816
var gl = this.gl;
839817

840818
var texture = gl.createTexture();
841819
var glScaleMode = (scaleMode === Phaser.scaleModes.LINEAR) ? gl.LINEAR : gl.NEAREST;
842820

843-
gl.activeTexture(gl.TEXTURE0);
821+
gl.activeTexture(gl.TEXTURE0 + textureIndex);
844822
gl.bindTexture(gl.TEXTURE_2D, texture);
845823

846824
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);

0 commit comments

Comments
 (0)