mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
New typedefs for pipeline configs
This commit is contained in:
parent
600385ac29
commit
37fdde7911
3 changed files with 35 additions and 0 deletions
12
src/renderer/webgl/typedefs/WebGLPipelineAttributesConfig.js
Normal file
12
src/renderer/webgl/typedefs/WebGLPipelineAttributesConfig.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig
|
||||
* @since 3.50.0
|
||||
*
|
||||
* @property {string} name - The name of the attribute as defined in the vertex shader.
|
||||
* @property {number} size - The number of components in the attribute, i.e. 1 for a float, 2 for a vec2, 3 for a vec3, etc.
|
||||
* @property {GLenum} type - The data type of the attribute. Either `gl.BYTE`, `gl.SHORT`, `gl.UNSIGNED_BYTE`, `gl.UNSIGNED_SHORT` or `gl.FLOAT`.
|
||||
* @property {number} offset - The offset, in bytes, of this attribute data in the vertex array. Equivalent to `offsetof(vertex, attrib)` in C.
|
||||
* @property {boolean} normalized - Should the attribute data be normalized?
|
||||
* @property {boolean} enabled - You should set this to `false` by default. The pipeline will enable it on boot.
|
||||
* @property {number} location - You should set this to `-1` by default. The pipeline will set it on boot.
|
||||
*/
|
14
src/renderer/webgl/typedefs/WebGLPipelineConfig.js
Normal file
14
src/renderer/webgl/typedefs/WebGLPipelineConfig.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Types.Renderer.WebGL.WebGLPipelineConfig
|
||||
* @since 3.50.0
|
||||
*
|
||||
* @property {Phaser.Game} game - The Phaser.Game instance that owns this pipeline.
|
||||
* @property {string} [name] - The name of the pipeline.
|
||||
* @property {GLenum} [topology=gl.TRIANGLES] - How the primitives are rendered. The default value is GL_TRIANGLES. Here is the full list of rendering primitives: (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants).
|
||||
* @property {string} [vertShader] - The source code, as a string, for the vertex shader.
|
||||
* @property {string} [fragShader] - The source code, as a string, for the fragment shader. Can include `%count%` and `%forloop%` declarations for multi-texture support.
|
||||
* @property {number} [vertexCapacity] - The number of vertices to hold in the batch. Defaults to `RenderConfig.batchSize` * 6.
|
||||
* @property {number} [vertexSize] - The size, in bytes, of a single entry in the vertex buffer. Defaults to Float32Array.BYTES_PER_ELEMENT * 6 + Uint8Array.BYTES_PER_ELEMENT * 4.
|
||||
* @property {ArrayBuffer} [vertices] - An optional Array Buffer full of pre-calculated vertices data.
|
||||
* @property {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig} [attributes] - An array of shader attribute data.
|
||||
*/
|
9
src/renderer/webgl/typedefs/index.js
Normal file
9
src/renderer/webgl/typedefs/index.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2020 Photon Storm Ltd.
|
||||
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.Types.Renderer.WebGL
|
||||
*/
|
Loading…
Reference in a new issue