Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    gl-quadpublic

    gl-quad

    unstable

    Creates an indexed quad that you can draw.

    var gl = require('webgl-context')
     
    var quad = require('gl-quad')(gl)
    quad.draw( myShader )

    The passed shader is expected to have position and uv attributes.

    Usage

    NPM

    functions

    var quad = createQuad(gl)

    Creates a new quad with position and texcoord buffers.

    quad.draw([shader])

    Draws the quad with a gl-shader.

    If a shader is not passed, it's assumed that you've already bound a shader.

    quad.dispose()

    Disposes the quad.

    members

    quad.vertices

    The vertex buffer.

    quad.texcoords

    The texcoord buffer.

    quad.elements

    The element buffer.

    quad.vao

    The Vertex Array Object backing this quad.

    License

    MIT, see LICENSE.md for details.

    install

    npm i gl-quad

    Downloadsweekly downloads

    6

    version

    1.1.3

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar