@vaalentin/gl-texture-display

0.0.1 • Public • Published

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 Texture
  • width (default 0.25), height (default 0.25), left (default 0.75) and top (default 0) 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.

Readme

Keywords

Package Sidebar

Install

npm i @vaalentin/gl-texture-display

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • vaalentin