mirror of
https://github.com/photonstorm/phaser
synced 2024-09-21 06:51:55 +00:00
Added isGLTexture property
This commit is contained in:
parent
aabd6d13df
commit
c33cf85456
1 changed files with 12 additions and 3 deletions
|
@ -140,6 +140,15 @@ var TextureSource = new Class({
|
|||
*/
|
||||
this.isRenderTexture = (source.type === 'RenderTexture');
|
||||
|
||||
/**
|
||||
* Is the source image a WebGLTexture?
|
||||
*
|
||||
* @name Phaser.Textures.TextureSource#isGLTexture
|
||||
* @type {boolean}
|
||||
* @since 3.19.0
|
||||
*/
|
||||
this.isGLTexture = (source instanceof WebGLTexture);
|
||||
|
||||
/**
|
||||
* Are the source image dimensions a power of two?
|
||||
*
|
||||
|
@ -187,13 +196,13 @@ var TextureSource = new Class({
|
|||
|
||||
this.glTexture = this.renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode);
|
||||
}
|
||||
else if (!(this.source instanceof WebGLTexture))
|
||||
else if (this.isGLTexture)
|
||||
{
|
||||
this.glTexture = this.renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode);
|
||||
this.glTexture = this.source;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.glTexture = this.source;
|
||||
this.glTexture = this.renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode);
|
||||
}
|
||||
}
|
||||
else if (this.isRenderTexture)
|
||||
|
|
Loading…
Reference in a new issue