mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
Added setBlankTexture method
This commit is contained in:
parent
1cc0e7d5e5
commit
d3e07b519a
1 changed files with 24 additions and 2 deletions
|
@ -533,12 +533,16 @@ var WebGLRenderer = new Class({
|
|||
*/
|
||||
boot: function ()
|
||||
{
|
||||
this.blankTexture = this.game.textures.getFrame('__DEFAULT').glTexture;
|
||||
|
||||
for (var pipelineName in this.pipelines)
|
||||
{
|
||||
this.pipelines[pipelineName].boot();
|
||||
}
|
||||
|
||||
var blank = this.game.textures.getFrame('__DEFAULT');
|
||||
|
||||
this.pipelines.FlatTintPipeline.currentFrame = blank;
|
||||
|
||||
this.blankTexture = blank;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -988,6 +992,24 @@ var WebGLRenderer = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the current active texture for texture unit zero to be a blank texture.
|
||||
* This only happens if there isn't a texture already in use by texture unit zero.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setBlankTexture
|
||||
* @private
|
||||
* @since 3.12.0
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
*/
|
||||
setBlankTexture: function ()
|
||||
{
|
||||
if (this.currentActiveTextureUnit !== 0 || !this.currentTextures[0])
|
||||
{
|
||||
this.setTexture2D(this.blankTexture.glTexture, 0);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Binds a texture at a texture unit. If a texture is already
|
||||
* bound to that unit it will force a flush on the current pipeline.
|
||||
|
|
Loading…
Reference in a new issue