Install
=======

Fetching
--------

Fetch the repo and then:

```
npm install
bower install
grunt
```

Source code structure
---------------------
`mix.js` is the main entry point for the code. It executes a couple polyfills and hooks up `[canvas,offscreencanvas].getContext()` to serve `mix` contexts.

`MIXContext` is the main context class. It subclasses all `MC*` files, that contain subsystems of MIXContext, like input, loader, renderer, etc. The `MC` modules are mostly independent, but they do sometimes expect some functionality to be available elsewhere.

There are support classes exported, like: `Shader`, `Sound` and `Texture`, but they are all served through `MIXContext`.

`utils/` has special utilities used inside `MIXContext`.

Running tests
-------------

Just open the `test/` directory in a browser and you should be fine.


Available grunt commands
------------------------

`watch`: watches for changes on `src/` and rebuilds the library.

`build`: builds the main ES5-compatible `out/mix.js`.

`lint`: lints all files on `src/` and `tests/`.

`package`: generates `out/mix.min.js`.

`export` or `release`: runs `lint`, `build` and `package`.

By default, grunt will run `lint` and `build`.
