loadCRN

异步加载并解析给定的CRN文件的URL或解析CRN文件的原始二进制数据。返回一个承诺,该承诺在加载后将解析为包含图像缓冲区、宽度、高度和格式的对象;如果URL未能加载或分析数据失败,则拒绝。使用xmlhttpRequest加载数据,这意味着为了向另一个来源发出请求,服务器必须启用跨来源资源共享(cors)头。
Parameters:
resourceOrUrlOrBuffer ((Resource | String | ArrayBuffer)) 二进制数据或ArrayBuffer的URL。
Example
// load a single URL asynchronously
bmgl.loadCRN('some/url').then(function(textureData) {
    var width = textureData.width;
    var height = textureData.height;
    var format = textureData.internalFormat;
    var arrayBufferView = textureData.bufferView;
    // use the data to create a texture
}).otherwise(function(error) {
    // an error occurred
});
Throws
See: