[glu3-devel] Still in development?

Ian Romanick idr at freedesktop.org
Mon Jan 10 08:43:38 PST 2011

Hash: SHA1

On 01/09/2011 02:13 PM, Kenneth Graunke wrote:
> On Saturday, January 08, 2011 09:42:22 pm Cameron Berkenpas wrote:
>> I'm guessing matrices are meant to be passed to OpenGL via glLoadMatrix and
>> glUniformMatrix. Is there a way to specifically convert a matrix to the
>> desired GLfloat * format or must this be done manually?
> Assuming "mvp" is a GLUmat4, you can do:
> glUniformMatrix4fv(mvp_location, 1, false, (float *) &mvp);
> This works due to the memory layout of GLUmat4 and GLUvec4: the first entry of 
> a GLUmat4 is an array of four GLUvec4 (column vectors) and each GLUvec4 is an 
> array of four GLfloats.  So you actually already have 16 floats in the 
> appropriate format.
> That's a bit unintuitive though...perhaps it'd make sense to have a 
> gluUniformMatrix function that takes a GLUmat4 and just does this.

This is how I had intended to handle this issue, but I've just never
gotten around to it.  Patches welcome, of course. :)
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the GLU3-devel mailing list