mirror of
https://github.com/photonstorm/phaser
synced 2024-11-15 01:17:43 +00:00
Array Remove and unbind before deleting the framebuffer
This commit is contained in:
parent
2d364f08c4
commit
1935119141
1 changed files with 36 additions and 34 deletions
|
@ -2291,10 +2291,20 @@ var WebGLRenderer = new Class({
|
|||
*/
|
||||
deleteFramebuffer: function (framebuffer)
|
||||
{
|
||||
if (framebuffer)
|
||||
if (!framebuffer)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
var gl = this.gl;
|
||||
|
||||
if (this.currentFramebuffer === framebuffer)
|
||||
{
|
||||
this.currentFramebuffer = null;
|
||||
}
|
||||
|
||||
ArrayRemove(this.fboStack, framebuffer);
|
||||
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
|
||||
|
||||
// Check for a color attachment and remove it
|
||||
|
@ -2320,14 +2330,6 @@ var WebGLRenderer = new Class({
|
|||
|
||||
gl.deleteFramebuffer(framebuffer);
|
||||
|
||||
ArrayRemove(this.fboStack, framebuffer);
|
||||
|
||||
if (this.currentFramebuffer === framebuffer)
|
||||
{
|
||||
this.currentFramebuffer = null;
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue