Add clearBeforeRender for <webgl>
Maybe "clearBeforeRender" this is not the best naming (since it will clear anyway..), but this aligns canvas and webgl: Basically it allows the user to do clearColor whenever they want, instead of this being done for them. This is useful in the following circumstance: 1) The game/program loads a background image, but not right away. 2) Before the background image is loaded, we want to fill the canvas with a certain color (for example, white). 3) In canvas mode, this is done by setting ``clearBeforeRender`` to false and then adding a single ``fillRect`` command. 4) In webGL mode, the equivalent is running ``gl.clearColor`` and then ``gl.clear``. 5) We can of course set the background color in webGL mode and this probably won't be expensive (although I don't know), but in canvas it *is* expensive to clear/fill on every frame. 6) Thus, the user would have to detect webGL mode or canvas mode themselves, and either set the background color or not. 7) To eliminate this coding complexity for the user, this small bit of extra code aligns ``clearBeforeRender`` (or, as much as possible) to the canvas implementation.
batch-dev
bugfix/polygon-offset
dev
dev-blendmode-add-again
dev-canvas-renderer-dirty-transform
dev-graphics-fix-batches
dev-line-join
dev-offscreen-canvas
dev-renderTexture-pool
dev-replace-buble-with-babel
englercj/update-s3
feature-nine-slice-canvas-tint
fix-svg
master
multiple-pointer-down-events
upgrade
v2.x
v3.x
v4.x
v5.0.4
v5.0.3
v5.0.2
v5.0.1
v5.0.0-rc.3
v5.0.0-rc.2
v5.0.0-rc
v5.0.0-alpha.3
v5.0.0-alpha.2
v5.0.0-alpha
v5.0.0
v4.8.8
v4.8.7
v4.8.6
v4.8.5
v4.8.4
v4.8.3
v4.8.2
v4.8.1
v4.8.0
v4.7.3
v4.7.2
v4.7.1
v4.7.0
v4.6.2
v4.6.1
v4.6.0
v4.5.6
v4.5.5
v4.5.4
v4.5.3
v4.5.2
v4.5.1
v4.5.0
v4.0.3
v4.0.2
v4.0.1
v4.0.0-rc4
v4.0.0-rc3
v4.0.0-rc2
v4.0.0-rc1
v4.0.0
v3.0.9
v3.0.8
v3.0.7
v3.0.6
v3.0.5
v3.0.4
v3.0.3
v3.0.2
v3.0.11
v3.0.10
v3.0.1
v3.0.0-rc4
v3.0.0-rc3
v3.0.0-rc2
v3.0.0-rc1
v3.0.0
v2.2.9
v2.2.8
v2.2.7
v2.2.6
v2.2.5
v2.2.4
v2.2.3
v2.2.2
v2.2.1
v2.2.0
v2.1.1
v2.1.01
v2.1.0
v2.0.0
floattex
2.0.0
|
---|
|
src/pixi/renderers/webgl/WebGLRenderer.js |
---|