is-webgl-context

1.1.0 • Public • Published

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 WebGL[2]RenderingContext, handling edge cases for WebGL debuggers/inspectors.

License

MIT, see LICENSE.md for details.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    6,332
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    6,332
  • 1.0.0
    2

Package Sidebar

Install

npm i is-webgl-context

Weekly Downloads

4,950

Version

1.1.0

License

MIT

Last publish

Collaborators

  • mattdesl