Skip to content

Commit 6e90d8e

Browse files
committed
Corrected docs and resetTextures
1 parent 18f3233 commit 6e90d8e

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

src/renderer/webgl/WebGLRenderer.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ var WebGLRenderer = new Class({
15181518
*
15191519
* @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound.
15201520
* @param {boolean} [updateScissor=false] - Set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack.
1521-
* @param {boolean} [resetTextures=true] - Should the WebGL Textures be reset after the new framebuffer is bound?
1521+
* @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound?
15221522
*
15231523
* @return {this} This WebGLRenderer instance.
15241524
*/
@@ -1546,14 +1546,14 @@ var WebGLRenderer = new Class({
15461546
*
15471547
* @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound.
15481548
* @param {boolean} [updateScissor=false] - If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack.
1549-
* @param {boolean} [resetTextures=true] - Should the WebGL Textures be reset after the new framebuffer is bound?
1549+
* @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound?
15501550
*
15511551
* @return {this} This WebGLRenderer instance.
15521552
*/
15531553
setFramebuffer: function (framebuffer, updateScissor, resetTextures)
15541554
{
15551555
if (updateScissor === undefined) { updateScissor = false; }
1556-
if (resetTextures === undefined) { resetTextures = true; }
1556+
if (resetTextures === undefined) { resetTextures = false; }
15571557

15581558
if (framebuffer === this.currentFramebuffer)
15591559
{
@@ -1626,7 +1626,7 @@ var WebGLRenderer = new Class({
16261626
framebuffer = null;
16271627
}
16281628

1629-
this.setFramebuffer(framebuffer);
1629+
this.setFramebuffer(framebuffer, false, true);
16301630
},
16311631

16321632
/**
@@ -1864,15 +1864,15 @@ var WebGLRenderer = new Class({
18641864
},
18651865

18661866
/**
1867-
* Wrapper for creating WebGLFramebuffer.
1867+
* Creates a WebGL Framebuffer object and optionally binds a depth stencil render buffer.
18681868
*
18691869
* @method Phaser.Renderer.WebGL.WebGLRenderer#createFramebuffer
18701870
* @since 3.0.0
18711871
*
1872-
* @param {integer} width - Width in pixels of the framebuffer
1873-
* @param {integer} height - Height in pixels of the framebuffer
1874-
* @param {WebGLTexture} renderTexture - The color texture to where the color pixels are written
1875-
* @param {boolean} addDepthStencilBuffer - Indicates if the current framebuffer support depth and stencil buffers
1872+
* @param {integer} width - If `addDepthStencilBuffer` is true, this controls the width of the depth stencil.
1873+
* @param {integer} height - If `addDepthStencilBuffer` is true, this controls the height of the depth stencil.
1874+
* @param {WebGLTexture} renderTexture - The color texture where the color pixels are written.
1875+
* @param {boolean} [addDepthStencilBuffer=false] - Create a Renderbuffer for the depth stencil?
18761876
*
18771877
* @return {WebGLFramebuffer} Raw WebGLFramebuffer
18781878
*/
@@ -1887,6 +1887,7 @@ var WebGLRenderer = new Class({
18871887
if (addDepthStencilBuffer)
18881888
{
18891889
var depthStencilBuffer = gl.createRenderbuffer();
1890+
18901891
gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
18911892
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
18921893
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer);
@@ -1915,7 +1916,7 @@ var WebGLRenderer = new Class({
19151916

19161917
this.setFramebuffer(null);
19171918

1918-
this.resetTextures(true);
1919+
this.resetTextures();
19191920

19201921
return framebuffer;
19211922
},

0 commit comments

Comments
 (0)