/webgl-utils

WebGL utils module

Primary LanguageJavaScript

webgl-utils.js

Travis npm package Coveralls

Origin from https://webglfundamentals.org/

Install

npm

npm install webgl-utils.js

yarn

yarn add webgl-utils.js

How to use

// Quick example
import * as webglUtils from 'webgl-utils.js';

// ...

// setup GLSL program
var program = webglUtils.createProgramFromScripts(gl, ["vertex-shader-2d", "fragment-shader-2d"]);

OR

// Quick example
import { createProgramFromScripts } from 'webgl-utils.js';

// ...

// setup GLSL program
var program = createProgramFromScripts(gl, ["vertex-shader-2d", "fragment-shader-2d"]);

Methods

✔ createAugmentedTypedArray
✔ createAttribsFromArrays
✔ createBuffersFromArrays
✔ createBufferInfoFromArrays
✔ createAttributeSetters
✔ createProgram
✔ createProgramFromScripts
✔ createProgramFromSources
✔ createProgramInfo
✔ createUniformSetters
✔ createVAOAndSetAttributes
✔ createVAOFromBufferInfo
✔ drawBufferInfo
✔ drawObjectList
✔ glEnumToString
✔ getExtensionWithKnownPrefixes
✔ loadShader
✔ resizeCanvasToDisplaySize
✔ setAttributes
✔ setBuffersAndAttributes
✔ setUniforms