1.0.5 • Published 9 months ago
@ahmerhh/webgraphiclibrary-context v1.0.5
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.
1.0.5
9 months ago