Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function setupWebGl(modV) {
const canvas = document.createElement('canvas')
const gl = canvas.getContext('webgl2', {
premultipliedAlpha: false,
antialias: true
})
const regl = createREGL({
gl,
attributes: {
antialias: true
}
})
const env = { gl, canvas, regl }
Object.defineProperty(env, 'defaultShader', {
get: () => defaultShader
})
modV.webgl = env
env.resize = (widthIn, heightIn, dpr = 1) => {
const width = widthIn * dpr