Skip to content

Commit

Permalink
API.md: Wrote documentation for the newly introduced properties of
Browse files Browse the repository at this point in the history
cube map and renderbuffer.
  • Loading branch information
Erkaman committed Aug 22, 2016
1 parent aaca505 commit 87caee0
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,32 @@ var cubemap = regl.cube({ ... })
cubemap.resize(16)
```

#### Cube map properties

The following properties contains information about the cube map.

| Property | Description |
| ------------------ | -------------------------------- |
| `width` | Width of a single cube map face |
| `height` | Height of a single cube map face |
| `format` | Texture Format |
| `type` | Texture Type |
| `mag` | Texture magnification filter |
| `min` | Texture minification filter |
| `wrapS` | Texture wrap mode on S axis |
| `wrapT` | Texture wrap mode on T axis |

They can be accessed after cube map creation like this:

```javascript
var c = regl.cube({
width: 2,
height: 2
})

console.log('cube: ', c.width, c.height, c.format, c.type, c.mag, c.min, c.wrapS, c.wrapT)
```

#### Cube map profiling

The following stats are tracked for each cube map in the `.stats` property:
Expand Down Expand Up @@ -2092,6 +2118,26 @@ var renderbuffer = regl.renderbuffer({
renderbuffer.resize(32, 32)
```

#### Renderbufffer properties

The following properties contains information about the cube map.

| Property | Description |
| ------------------ | -------------------------------- |
| `width` | Width of the renderbuffer |
| `height` | Height of the renderbuffer |
| `format` | Format of the renderbuffer |

They can be accessed after renderbuffer creation like this:

```javascript
var r = regl.renderbuffer({shape: [1, 1],
format: 'rgb5 a1'
})

console.log('renderbuffer: ', r.width, r.height, r.format)
```

#### Renderbuffers destructor

```javascript
Expand Down

0 comments on commit 87caee0

Please sign in to comment.