27 lines
1.3 KiB
JavaScript
27 lines
1.3 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$utils$browser$isWebGLSupported = function(global, require, module, exports) {
|
|
var adapter = require("module$node_modules$pixi_DOT_js$lib$environment$adapter"), AbstractRenderer = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$system$AbstractRenderer");
|
|
"use strict";
|
|
let _isWebGLSupported;
|
|
exports.isWebGLSupported = function(failIfMajorPerformanceCaveat) {
|
|
return void 0 !== _isWebGLSupported ? _isWebGLSupported : _isWebGLSupported = (() => {
|
|
var contextOptions = {stencil:!0, failIfMajorPerformanceCaveat:failIfMajorPerformanceCaveat ?? AbstractRenderer.AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat};
|
|
try {
|
|
if (!adapter.DOMAdapter.get().getWebGLRenderingContext()) {
|
|
return !1;
|
|
}
|
|
let gl = adapter.DOMAdapter.get().createCanvas().getContext("webgl", contextOptions);
|
|
contextOptions = !!gl?.getContextAttributes()?.stencil;
|
|
if (gl) {
|
|
const loseContext = gl.getExtension("WEBGL_lose_context");
|
|
loseContext && loseContext.loseContext();
|
|
}
|
|
return contextOptions;
|
|
} catch (_e) {
|
|
return !1;
|
|
}
|
|
})();
|
|
};
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$utils$browser$isWebGLSupported.js.map
|