openframeworks/openFrameworks — pull request #3153 by tgfrerer (2014-08-15 10:38:06+00:00)
Title: Fix view matrix programmable

fixes #3151.

When drawing directly after ```mCam.begin()``` the ```ModelViewProjection``` matrix would not have been properly set up (see also: renders & test case in #3151). The same issue might also have led to a virtual one-frame lag in camera updates in some situations.

This because a camera would just update the ```View``` matrix, but this update would not automatically cause the dependent matrices further up it's hierarchy to re-calculate.

### This PR addresses this issue by:

* DRYing matrix stack code so as to have unified execution paths
* Uploading matrices to the shader in one central location
* Making sure view matrices can only be updated whilst matrixMode == ```OF_MATRIX_MODELVIEW```
* Making sure matrices dependent on ViewMatrix get updated whenever View changes.