Added new WebGL consts for easier shader configs

This commit is contained in:
Richard Davey 2020-10-28 16:14:05 +00:00
parent 9aeb765696
commit 93b1775aaa
2 changed files with 86 additions and 1 deletions

View file

@ -0,0 +1,74 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var WEBGL_CONST = {
/**
* 8-bit twos complement signed integer.
*
* @name Phaser.Renderer.WebGL.BYTE
* @type {Phaser.Types.Renderer.WebGL.WebGLConst}
* @since 3.50.0
*/
BYTE: { enum: 0x1400, size: 1 },
/**
* 8-bit twos complement unsigned integer.
*
* @name Phaser.Renderer.WebGL.UNSIGNED_BYTE
* @type {Phaser.Types.Renderer.WebGL.WebGLConst}
* @since 3.50.0
*/
UNSIGNED_BYTE: { enum: 0x1401, size: 1 },
/**
* 16-bit twos complement signed integer.
*
* @name Phaser.Renderer.WebGL.SHORT
* @type {Phaser.Types.Renderer.WebGL.WebGLConst}
* @since 3.50.0
*/
SHORT: { enum: 0x1402, size: 2 },
/**
* 16-bit twos complement unsigned integer.
*
* @name Phaser.Renderer.WebGL.UNSIGNED_SHORT
* @type {Phaser.Types.Renderer.WebGL.WebGLConst}
* @since 3.50.0
*/
UNSIGNED_SHORT: { enum: 0x1403, size: 2 },
/**
* 32-bit twos complement signed integer.
*
* @name Phaser.Renderer.WebGL.INT
* @type {Phaser.Types.Renderer.WebGL.WebGLConst}
* @since 3.50.0
*/
INT: { enum: 0x1404, size: 4 },
/**
* 32-bit twos complement unsigned integer.
*
* @name Phaser.Renderer.WebGL.UNSIGNED_INT
* @type {Phaser.Types.Renderer.WebGL.WebGLConst}
* @since 3.50.0
*/
UNSIGNED_INT: { enum: 0x1405, size: 4 },
/**
* 32-bit IEEE floating point number.
*
* @name Phaser.Renderer.WebGL.FLOAT
* @type {Phaser.Types.Renderer.WebGL.WebGLConst}
* @since 3.50.0
*/
FLOAT: { enum: 0x1406, size: 4 }
};
module.exports = WEBGL_CONST;

View file

@ -4,11 +4,14 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var WEBGL_CONST = require('./const');
var Extend = require('../../utils/object/Extend');
/**
* @namespace Phaser.Renderer.WebGL
*/
module.exports = {
var WebGL = {
PipelineManager: require('./PipelineManager'),
Pipelines: require('./pipelines'),
@ -17,3 +20,11 @@ module.exports = {
WebGLRenderer: require('./WebGLRenderer')
};
// Merge in the consts
WebGL = Extend(false, WebGL, WEBGL_CONST);
// Export it
module.exports = WebGL;