Skip to content

Commit

Permalink
update API and change log
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolalysenko committed Aug 14, 2016
1 parent 0f3a936 commit 708929f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 12 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2469,9 +2469,19 @@ regl.destroy()

### Context loss

`regl` makes a best faith effort to handle context loss by default. This means that buffers and textures are reinitialized on a context restore with their contents.
`regl` makes a best faith effort to handle context loss by default. This means that buffers and textures are reinitialized on a context restore with their contents. This can be done using the context loss events exposed by `regl`. For example:

**TODO**
```javascript
var regl = require('regl')()

regl.on('lost', function () {
console.log('lost webgl context')
})

regl.on('restore', function () {
console.log('webgl context restored')
})
```

* * *

Expand Down
7 changes: 2 additions & 5 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

## Planned

* Context loss

* Write comparison suite

* Comments for all core modules

* Update contributing guidelines, make it easier for people to help out

* Add a mechanism for users to specify minimum resource requirements (texture size, varying units, etc.)

* Benchmark suite
Expand All @@ -31,7 +27,6 @@

* Helper modules

* A camera helper module to make getting started with 3D code easier
* Debugging tools for inspecting the state of framebuffers, textures, buffers

* Recipe book/example set
Expand All @@ -43,6 +38,8 @@

## Next

* Implement basic context loss handling
* Add `regl.on` for hooking events
* Add `regl.now()`, allows sampling timer at high resolution outside of `regl.frame` in order to better synchronize DOM events

## 0.11.0
Expand Down

0 comments on commit 708929f

Please sign in to comment.