1.1.0 • Published 9 years ago

is-webgl-context v1.1.0

Weekly downloads
865
License
MIT
Repository
github
Last release
9 years ago

is-webgl-context

stable

Test whether the given object is a WebGL or WebGL2 context. This is useful to handle edge-cases, such as when Chrome WebGL Inspector wraps WebGLRenderingContext in a different type.

Runs in Node and the browser.

var isGL = require('is-webgl-context')

isGL(foo)

Usage

NPM

isGLContext(obj)

Returns true if the object is an instance of WebGL2RenderingContext, handling edge cases for WebGL debuggers/inspectors.

License

MIT, see LICENSE.md for details.