mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Added supportsCompressedTexture method
This commit is contained in:
parent
5a941ed509
commit
7bdb9d672f
1 changed files with 30 additions and 0 deletions
|
@ -1041,6 +1041,36 @@ var WebGLRenderer = new Class({
|
|||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the given compressed texture format is supported, or not.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#supportsCompressedTexture
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @param {string} baseFormat - The Base Format to check.
|
||||
* @param {GLenum} [format] - An optional GLenum format to check within the base format.
|
||||
*
|
||||
* @return {boolean} True if the format is supported, otherwise false.
|
||||
*/
|
||||
supportsCompressedTexture: function (baseFormat, format)
|
||||
{
|
||||
var supportedFormats = this.compression[baseFormat.toUpperCase()];
|
||||
|
||||
if (supportedFormats)
|
||||
{
|
||||
if (format)
|
||||
{
|
||||
return format in supportedFormats;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the aspect ratio of the WebGLRenderer dimensions.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue