npm.io
1.0.0 • Published 11 years ago

is-webgl2-context

Licence
MIT
Version
1.0.0
Deps
0
Vulns
0
Weekly
0
Stars
6

is-webgl2-context

stable

Test whether a canvas context is using WebGL 2.

var isWebGL2 = require('is-webgl2-context')

if (isWebGL2(gl)) {
  // do 2.0 effects
} else {
  // do 1.0 effects
}

Usage

NPM

bool = isWebGL2(gl)

Returns true if gl is an instance of WebGL2RenderingContext.

See Also

License

MIT, see LICENSE.md for details.

Keywords