JSPM

gl-constants

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 37101
  • Score
    100M100P100Q141550F
  • License MIT

all the WebGL 1.0 constants

Package Exports

  • gl-constants
  • gl-constants/lookup

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gl-constants) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gl-constants

stable

All the WebGL 1.0 constants as a module. Useful for testing.

var constants = require('gl-constants')

texture.minFilter = constants.LINEAR
texture.magFilter = constants.NEAREST

You can also 'lookup' a constant by number:

var lookup = require('gl-constants/lookup')

console.log(lookup(1282)) // INVALID_OPERATION

Note that some fields share the same number, like NONE, ZERO POINTS and NO_ERROR all use 0.

Usage

NPM

require('gl-constants')

An object where each key corresponds to the WebGL constant integer value.

require('gl-constants/lookup')(number)

Returns the key name associated with the given WebGL constant integer value.

License

MIT, see LICENSE.md for details.