jeromeetienne/threex.windowresize — pull request #2 by SebastianNette (2014-07-11 21:57:45+00:00)
Title: added callback for renderer size

window.innerWidth and window.innerHeight are only useful, if the canvas
is actually filling the whole screen. This is not always the case. E.g.
the game has a sidebar for ads, an user interface written in html/css at
the bottom, a navigation bar at the top, etc.

Example: The game has a chat at the bottom with a height of 200px, the
new code would look like this:

```javascript
var windowResize = new THREEx.WindowResize(aRenderer, aCamera, function(){
return { width: window.innerWidth, height: window.innerHeight - 200 }
})
```

The dimension callback is optional and can also be used to execute other functions on
window resize without manually adding another event listener.