0.0.1 • Published 8 years ago

@vaalentin/gl-texture-display v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

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.