mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 09:48:18 +00:00
Added new WebGL consts for easier shader configs
This commit is contained in:
parent
9aeb765696
commit
93b1775aaa
2 changed files with 86 additions and 1 deletions
74
src/renderer/webgl/const.js
Normal file
74
src/renderer/webgl/const.js
Normal 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;
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue