Quote Originally Posted by dmantione
No, the row/column ordering doesn't match OpenGL. Interfacing with OpenGL is still very easy, i.e.:
[pascal]
var m:Tmatrix4_single;

begin
with m.transpose do
glLoadMatrixF(@data);
[/pascal]
I'm going to put this into the documentation.
Or just
[pascal]glLoadMatrixF(@m.transpose.data);[/pascal]

Actually, it would be nice to add a unit like GLMatrix that defines overloaded versions of glLoadMatrix routines that just take Tmatrix4_single/double as arguments and do the transpose inside implementation.

I even thought about doing descendants like TMatrix4_single_GL that have methods like glLoadMatrix with implementation like

[pascal]
procedure TMatrix4_single_GL.glLoadMatrix;
begin
GL.glLoadMatrix(@transpose.data);
end;
[/pascal]

... but this will not be so nice, since you will have to override some operators again for new TMatrix4_single_GL class, and if you receive your matrix instance from some non-OpenGL-related unit then it will still have normal TMatrix4_single class, not TMatrix4_single_GL. So making non-object procedures like glLoadMatrix(M: TMatrix4_single) would be more general solution to "hide" the "transpose." call from the eyes of the programmer.