
On Fri, Jun 6, 2014 at 1:39 PM, Peter Dimov
Emil Dotchevski wrote:
If a matrix type stores its values as anything but a 1-dimensional array in column-major order, you can't (portably) feed it into glUniformMatrix4fv without a temporary; at least it'd require a cast, which in theory may not work on some platform.
Actually, a two-dimensional array is guaranteed to be laid out linearly in memory. The rest of the message still stands though.
You need a cast, and my understanding is that that makes your code not portable because it violates the strict aliasing rule. This is purely theoretical, obviously, in practice it'll most likely work. Anyway, if you want to use a 2D array and cast it to 1D array, there is nothing in the QVM library that would get in your way. -- Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode