Skip to content

Commit

Permalink
Merge pull request regl-project#363 from regl-project/error-message-docs
Browse files Browse the repository at this point in the history
Update docs around error messages
  • Loading branch information
mikolalysenko authored Oct 8, 2016
2 parents 48abba2 + 63b6ec4 commit 50263c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,14 @@ var regl = require('regl')(require('gl')(256, 256))

* * *

### Error messages and debug mode

By default if you compile `regl` with browserify then all error messages and checks are removed. This is done in order to reduce the size of the final bundle and to improve run time performance.

**If you want error messages and are using browserify make sure that you compile using `--debug`**. Not only will this insert debug messages but it will also give you source maps which make finding errors easier.

Alternatively, consider using [`budo`](https://github.com/mattdesl/budo) for your live development server. `budo` automatically compiles your code in debug mode and also provides facilities for live reloading.

## Commands

_Draw commands_ are the fundamental abstraction in `regl`. A draw command wraps up all of the WebGL state associated with a draw call (either `drawArrays` or `drawElements`) and packages it into a single reusable function. For example, here is a command that draws a triangle,
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ npm i -S regl

For more info on how to use npm, [check out the official docs](https://docs.npmjs.com/).

If you are using npm, you may also want to try [`budo`](https://github.com/mattdesl/budo) which is a live development server.

#### Run time error checking and browserify

By default if you compile `regl` with `browserify` then all error messages and run time checks are removed. This is done to reduce the size of the final bundle. If you are developing an application, you should run browserify using the `--debug` flag in order to enable error messages. This will also generate source maps which make reading the source code of your application easier.

### Standalone script tag

You can also use `regl` as a standalone script if you are really stubborn. The most recent versions can be found in the `dist/` folder and is also available from [npm cdn](https://npmcdn.com) in both minified and unminified versions.
Expand Down

0 comments on commit 50263c1

Please sign in to comment.