gl-react-dom
Version:
DOM implementation of gl-react, an universal React library to write and compose WebGL shaders
24 lines (18 loc) • 583 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const getContext = (canvas, opts, version) => {
let gl;
if (version === "webgl2" || version === "auto") {
gl = canvas.getContext("webgl2", opts);
}
if (!gl && (version === "webgl" || version === "auto")) {
gl = canvas.getContext("webgl", opts) || canvas.getContext("webgl-experimental", opts) || canvas.getContext("experimental-webgl", opts);
}
return gl;
};
var _default = getContext;
exports.default = _default;
//# sourceMappingURL=getContext.js.map