Skip to content

Commit f93c3ea

Browse files
committed
Added Pipeline events
1 parent f18d615 commit f93c3ea

9 files changed

Lines changed: 150 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The WebGLPipeline After Flush Event.
9+
*
10+
* This event is dispatched by a WebGLPipeline right after it has issued a drawArrays command
11+
* and cleared its vertex count.
12+
*
13+
* @event Phaser.Renderer.WebGL.Pipelines.Events#AFTER_FLUSH
14+
* @since 3.50.0
15+
*
16+
* @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that has flushed.
17+
* @param {boolean} isPostFlush - Was this flush invoked as part of a post-process, or not?
18+
*/
19+
module.exports = 'pipelineafterflush';
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The WebGLPipeline Before Flush Event.
9+
*
10+
* This event is dispatched by a WebGLPipeline right before it is about to
11+
* flush and issue a bufferData and drawArrays command.
12+
*
13+
* @event Phaser.Renderer.WebGL.Pipelines.Events#BEFORE_FLUSH
14+
* @since 3.50.0
15+
*
16+
* @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that is about to flush.
17+
* @param {boolean} isPostFlush - Was this flush invoked as part of a post-process, or not?
18+
*/
19+
module.exports = 'pipelinebeforeflush';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The WebGLPipeline Bind Event.
9+
*
10+
* This event is dispatched by a WebGLPipeline when it is bound by the Pipeline Manager.
11+
*
12+
* @event Phaser.Renderer.WebGL.Pipelines.Events#BIND
13+
* @since 3.50.0
14+
*
15+
* @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that was bound.
16+
* @param {Phaser.Renderer.WebGL.WebGLShader} currentShader - The shader that was set as being current.
17+
*/
18+
module.exports = 'pipelinebind';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The WebGLPipeline Boot Event.
9+
*
10+
* This event is dispatched by a WebGLPipeline when it has completed its `boot` phase.
11+
*
12+
* @event Phaser.Renderer.WebGL.Pipelines.Events#BOOT
13+
* @since 3.50.0
14+
*
15+
* @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that booted.
16+
*/
17+
module.exports = 'pipelineboot';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The WebGLPipeline Destroy Event.
9+
*
10+
* This event is dispatched by a WebGLPipeline when it is starting its destroy process.
11+
*
12+
* @event Phaser.Renderer.WebGL.Pipelines.Events#DESTROY
13+
* @since 3.50.0
14+
*
15+
* @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that has flushed.
16+
*/
17+
module.exports = 'pipelinedestroy';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The WebGLPipeline ReBind Event.
9+
*
10+
* This event is dispatched by a WebGLPipeline when it is re-bound by the Pipeline Manager.
11+
*
12+
* @event Phaser.Renderer.WebGL.Pipelines.Events#REBIND
13+
* @since 3.50.0
14+
*
15+
* @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that was rebound.
16+
* @param {Phaser.Renderer.WebGL.WebGLShader} currentShader - The shader that was set as being current.
17+
*/
18+
module.exports = 'pipelinerebind';
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* The WebGLPipeline Resize Event.
9+
*
10+
* This event is dispatched by a WebGLPipeline when it is resized, usually as a result
11+
* of the Renderer resizing.
12+
*
13+
* @event Phaser.Renderer.WebGL.Pipelines.Events#RESIZE
14+
* @since 3.50.0
15+
*
16+
* @param {number} width - The new width of the pipeline.
17+
* @param {number} height - The new height of the pipeline.
18+
* @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that was resized.
19+
*/
20+
module.exports = 'pipelineresize';
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
/**
8+
* @namespace Phaser.Renderer.WebGL.Pipelines.Events
9+
*/
10+
11+
module.exports = {
12+
13+
AFTER_FLUSH: require('./AFTER_FLUSH_EVENT'),
14+
BEFORE_FLUSH: require('./BEFORE_FLUSH_EVENT'),
15+
BIND: require('./BIND_EVENT'),
16+
BOOT: require('./BOOT_EVENT'),
17+
DESTROY: require('./DESTROY_EVENT'),
18+
REBIND: require('./REBIND_EVENT'),
19+
RESIZE: require('./RESIZE_EVENT')
20+
21+
};

src/renderer/webgl/pipelines/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var Extend = require('../../../utils/object/Extend');
1414
var Pipelines = {
1515

1616
BitmapMaskPipeline: require('./BitmapMaskPipeline'),
17+
Events: require('./events'),
1718
GraphicsPipeline: require('./GraphicsPipeline'),
1819
LightPipeline: require('./LightPipeline'),
1920
MultiPipeline: require('./MultiPipeline'),

0 commit comments

Comments
 (0)