# @vaalentin/gl-shader

> WebGL shader wrapper.

Latest version **1.0.3** (published 2016-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vaalentin/gl-shader
pnpm add @vaalentin/gl-shader
yarn add @vaalentin/gl-shader
bun add @vaalentin/gl-shader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2016-02-08 |
| First published | 2016-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Vaalentin |
| Maintainers | vaalentin |
| Keywords | WebGL, shader |

## Links

- npm: https://www.npmjs.com/package/@vaalentin/gl-shader
- Repository: https://github.com/vaalentin/gl-shader
- Homepage: https://github.com/vaalentin/gl-shader#readme
- Issues: https://github.com/vaalentin/gl-shader/issues
- npm.io page: https://npm.io/package/@vaalentin/gl-shader

## Dependencies (1)

- [@vaalentin/gl-context](https://npm.io/package/@vaalentin/gl-context.md) ^1.0.2

## Recent versions

- 1.0.3 (latest) — 2016-02-08
- 1.0.2 — 2016-01-16
- 1.0.1 — 2016-01-08
- 1.0.0 — 2016-01-07

## README

# GL Shader

WebGL shader wrapper.

## Installation

```sh
$ npm install --save @vaalentin/gl-shader
```

## Usage

```js
import Shader from '@vaalentin/gl-shader';

// setup canvas and gl

const vertexShader = new Shader(gl, gl.VERTEX_SHADER,
  `
  attribute vec3 aPos;

  void main() {
    gl_Position = vec4(aPos, 1.0);
  }
`);
```

## API

#### `shader = new Shader(gl, type, src)`

Create a new shader, where:
- `gl` is the [WebGL context](https://github.com/vaalentin/gl-context).
- `type` is the shader type: `gl.VERTEX_SHADER` or `gl.FRAGMENT_SHADER`.
- `src` is the shader source, as a `string`.

#### `shader.dispose()`

Delete instance. Calls `gl.deleteShader`.

## License

MIT, see [LICENSE.md](https://github.com/vaalentin/gl-shader/blob/master/LICENSE.md) for more details.

## Credits

Thanks to the amazing [stackgl](http://stack.gl/) for the inspiration.

---
_Source: https://npm.io/package/@vaalentin/gl-shader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
