@ahmerhh/webgraphiclibrary-context
v1.0.5
Published
Get the WebGL context from a canva`s.
Downloads
4
Readme
Web Graphic Library Context
Get the Web Graphic Library context from a canvas.
Installation
$ npm install --save @ahmerhh/WebGraphicLibrary-context
Usage
import getGl from '@ahmerhh/WebGraphicLibrary-context';
const canvas = document.createElement('canvas');
const gl = getWebGLContext(canvas);
if(gl == null) {
// WebGraphicLibrary is not supported
}
API
gl = getWebGLContext(canvas)
Returns the WebGraphicLibrary
context from the canvas
. If it fails, gl
is null
.
License
MIT, see LICENSE.md for more details.
Credits
Thanks to the amazing stackgl for the inspiration.