MCPcopy Create free account
hub / github.com/microsoft/SandDance / initializeExtensions

Function initializeExtensions

docs/tests/v2/es6/js/sanddance.js:2613–2640  ·  view source on GitHub ↗
(gl)

Source from the content-addressed store, hash-verified

2611}), _WEBGL_CONTEXT_POLYFI);
2612
2613function initializeExtensions(gl) {
2614 gl.luma.extensions = {}; // `getSupportedExtensions` can return null when context is lost.
2615
2616 var EXTENSIONS = gl.getSupportedExtensions() || [];
2617 var _iteratorNormalCompletion = true;
2618 var _didIteratorError = false;
2619 var _iteratorError = undefined;
2620
2621 try {
2622 for (var _iterator = EXTENSIONS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2623 var extension = _step.value;
2624 gl.luma[extension] = gl.getExtension(extension);
2625 }
2626 } catch (err) {
2627 _didIteratorError = true;
2628 _iteratorError = err;
2629 } finally {
2630 try {
2631 if (!_iteratorNormalCompletion && _iterator.return != null) {
2632 _iterator.return();
2633 }
2634 } finally {
2635 if (_didIteratorError) {
2636 throw _iteratorError;
2637 }
2638 }
2639 }
2640} // Polyfills a single WebGL extension into the `target` object
2641
2642
2643function polyfillExtension(gl, _ref) {

Callers 1

polyfillContextFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected