@vaalentin/gl-texture-display
v0.0.1
Published
Display a WebGL texture.
Readme
GL Texture display
Display a WebGL texture. Usefull to display the content of a fbo.
Installation
$ npm install --save @vaalentin/gl-texture-displayUsage
import TextureDisplay from '@vaalentin/gl-texture-display';
// set gl and texture
const display = new TextureDisplay(gl, texture);
// then in the render loop
display.render();API
display = new TextureDisplay(gl, texture [, width, height, left, top])
Create a new instance, where:
glis the WebGL context.textureis a Texturewidth(default0.25),height(default0.25),left(default0.75) andtop(default0) are all normalized values (1being fullscreen).
display.render([unit])
Render using the given unit (default is 0).
display.dispose()
Delete instance. Let the texture intact.
License
MIT, see LICENSE.md for more details.
