gl-canvas
a Custom Element that extends
<canvas>
with handlers for the WebGL context and various events.
Usage
Note: twgl.js
is not required but highly reccomended when working with raw WebGL calls
in HTML
<script type="module" src="gl-canvas.esm.js"></script>
<gl-canvas></gl-canvas>
Installation
npm install gl-canvas
Features
- Set WebGL context attributes with HTML attributes
- Viewport automatically resizes with element (using
ResizeObserver
)
Contributing
Pull requests and suggestions are very welcome now
License
MIT