Skip to content

Commit 4843d7e

Browse files
committed
Pipelines have a boot handler now.
1 parent 61954de commit 4843d7e

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

src/renderer/webgl/WebGLPipeline.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,19 @@ var WebGLPipeline = new Class({
238238
this.active = false;
239239
},
240240

241+
/**
242+
* Called when the Game has fully booted and the Renderer has finished setting up.
243+
*
244+
* By this stage all Game level systems are now in place and you can perform any final
245+
* tasks that the pipeline may need that relied on game systems such as the Texture Manager.
246+
*
247+
* @method Phaser.Renderer.WebGL.WebGLPipeline#boot
248+
* @since 3.11.0
249+
*/
250+
boot: function ()
251+
{
252+
},
253+
241254
/**
242255
* Adds a description of vertex attribute to the pipeline
243256
*

src/renderer/webgl/WebGLRenderer.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,26 @@ var WebGLRenderer = new Class({
519519
this.setBlendMode(CONST.BlendModes.NORMAL);
520520
this.resize(this.width, this.height);
521521

522+
this.game.events.once('ready', this.boot, this);
523+
522524
return this;
523525
},
524526

527+
/**
528+
* Internal boot handler. Calls 'boot' on each pipeline.
529+
*
530+
* @method Phaser.Renderer.WebGL.WebGLRenderer#boot
531+
* @private
532+
* @since 3.11.0
533+
*/
534+
boot: function ()
535+
{
536+
for (var pipelineName in this.pipelines)
537+
{
538+
this.pipelines[pipelineName].boot();
539+
}
540+
},
541+
525542
/**
526543
* [description]
527544
*
@@ -553,7 +570,7 @@ var WebGLRenderer = new Class({
553570

554571
gl.viewport(0, 0, this.width, this.height);
555572

556-
// Update all registered pipelines
573+
// Update all registered pipelines
557574
for (var pipelineName in pipelines)
558575
{
559576
pipelines[pipelineName].resize(width, height, resolution);

0 commit comments

Comments
 (0)