Skip to content

ahmerhh/WebGraphicLibrary-context

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

WebGraphicLibrary context is a lightweight npm package that provides a simple function to retrieve the WebGL context from an HTML canvas element.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published