mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +00:00
WebGLRenderer.deleteTexture
will check to see if the texture it is being asked to delete is the currently bound texture or not. If it is, it'll set the blank texture to be bound after deletion. This should stop RENDER WARNING: there is no texture bound to the unit 0
errors if you destroy a Game Object, such as Text or TileSprite, from an async or timed process
This commit is contained in:
parent
ad2ef6a742
commit
5bdf9aa21b
2 changed files with 8 additions and 0 deletions
|
@ -6,6 +6,8 @@
|
|||
|
||||
### Updates
|
||||
|
||||
* `WebGLRenderer.deleteTexture` will check to see if the texture it is being asked to delete is the currently bound texture or not. If it is, it'll set the blank texture to be bound after deletion. This should stop `RENDER WARNING: there is no texture bound to the unit 0` errors if you destroy a Game Object, such as Text or TileSprite, from an async or timed process (thanks jamespierce)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
### Examples and TypeScript
|
||||
|
|
|
@ -1470,6 +1470,12 @@ var WebGLRenderer = new Class({
|
|||
|
||||
this.gl.deleteTexture(texture);
|
||||
|
||||
if (this.currentTextures[0] === texture)
|
||||
{
|
||||
// texture we just deleted is in use, so bind a blank texture
|
||||
this.setBlankTexture(true);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue