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