README
GL Texture display
Display a WebGL texture. Usefull to display the content of a fbo.
Installation
$ npm install --save @vaalentin/gl-texture-display
Usage
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:
gl
is the WebGL context.texture
is a Texturewidth
(default0.25
),height
(default0.25
),left
(default0.75
) andtop
(default0
) are all normalized values (1
being 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.