Added flush argument

This commit is contained in:
Richard Davey 2018-12-11 14:59:50 +00:00
parent d9f89fbde1
commit 5683713253

View file

@ -1140,13 +1140,18 @@ var WebGLRenderer = new Class({
*
* @return {this} This WebGLRenderer instance.
*/
setTexture2D: function (texture, textureUnit)
setTexture2D: function (texture, textureUnit, flush)
{
if (flush === undefined) { flush = true; }
var gl = this.gl;
if (texture !== this.currentTextures[textureUnit])
{
this.flush();
if (flush)
{
this.flush();
}
if (this.currentActiveTextureUnit !== textureUnit)
{