Pipelines have a boot handler now.

This commit is contained in:
Richard Davey 2018-07-13 11:13:46 +01:00
parent 61954dedcb
commit 4843d7eefe
2 changed files with 31 additions and 1 deletions

View file

@ -238,6 +238,19 @@ var WebGLPipeline = new Class({
this.active = false;
},
/**
* Called when the Game has fully booted and the Renderer has finished setting up.
*
* By this stage all Game level systems are now in place and you can perform any final
* tasks that the pipeline may need that relied on game systems such as the Texture Manager.
*
* @method Phaser.Renderer.WebGL.WebGLPipeline#boot
* @since 3.11.0
*/
boot: function ()
{
},
/**
* Adds a description of vertex attribute to the pipeline
*

View file

@ -519,9 +519,26 @@ var WebGLRenderer = new Class({
this.setBlendMode(CONST.BlendModes.NORMAL);
this.resize(this.width, this.height);
this.game.events.once('ready', this.boot, this);
return this;
},
/**
* Internal boot handler. Calls 'boot' on each pipeline.
*
* @method Phaser.Renderer.WebGL.WebGLRenderer#boot
* @private
* @since 3.11.0
*/
boot: function ()
{
for (var pipelineName in this.pipelines)
{
this.pipelines[pipelineName].boot();
}
},
/**
* [description]
*
@ -553,7 +570,7 @@ var WebGLRenderer = new Class({
gl.viewport(0, 0, this.width, this.height);
// Update all registered pipelines
// Update all registered pipelines
for (var pipelineName in pipelines)
{
pipelines[pipelineName].resize(width, height, resolution);