mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 06:30:38 +00:00
Allow premultiplication setting on Uint8Array textures.
This commit is contained in:
parent
a58f6d0f0c
commit
877fe3aa30
1 changed files with 5 additions and 2 deletions
|
@ -3460,9 +3460,10 @@ var WebGLRenderer = new Class({
|
|||
* @param {Uint8Array} data - The Uint8Array to create the texture from.
|
||||
* @param {number} width - The width of the texture.
|
||||
* @param {number} height - The height of the texture.
|
||||
* @param {boolean} [pma = true] - Should the texture be set as having premultiplied alpha?
|
||||
* @return {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} The newly created WebGLTextureWrapper.
|
||||
*/
|
||||
createUint8ArrayTexture: function (data, width, height)
|
||||
createUint8ArrayTexture: function (data, width, height, pma)
|
||||
{
|
||||
var gl = this.gl;
|
||||
var minFilter = gl.NEAREST;
|
||||
|
@ -3476,7 +3477,9 @@ var WebGLRenderer = new Class({
|
|||
wrap = gl.REPEAT;
|
||||
}
|
||||
|
||||
return this.createTexture2D(0, minFilter, magFilter, wrap, wrap, gl.RGBA, data, width, height);
|
||||
if (pma === undefined) { pma = true; }
|
||||
|
||||
return this.createTexture2D(0, minFilter, magFilter, wrap, wrap, gl.RGBA, data, width, height, pma);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue