diff options
author | Brian Paul <[email protected]> | 1999-12-10 20:01:06 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 1999-12-10 20:01:06 +0000 |
commit | cd96388857255711c4e33e7d2626f199d3810d15 (patch) | |
tree | d0781e62e698ee5ae1468a5dc36a901254641c53 /src/mesa/main/matrix.c | |
parent | 0056c5e40d7c5702420f314fa4f68159e5a64cd6 (diff) |
implemented GL_ARB_tranpose_matrix
Diffstat (limited to 'src/mesa/main/matrix.c')
-rw-r--r-- | src/mesa/main/matrix.c | 82 |
1 files changed, 81 insertions, 1 deletions
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index afd33ed0150..a86c0d3d6fc 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -1,4 +1,4 @@ -/* $Id: matrix.c,v 1.11 1999/11/24 18:48:31 brianp Exp $ */ +/* $Id: matrix.c,v 1.12 1999/12/10 20:01:06 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -537,6 +537,50 @@ GLboolean gl_matrix_invert( GLmatrix *mat ) +void gl_matrix_transposef( GLfloat to[16], const GLfloat from[16] ) +{ + to[0] = from[0]; + to[1] = from[4]; + to[2] = from[8]; + to[3] = from[12]; + to[4] = from[1]; + to[5] = from[5]; + to[6] = from[9]; + to[7] = from[13]; + to[8] = from[2]; + to[9] = from[6]; + to[10] = from[10]; + to[11] = from[14]; + to[12] = from[3]; + to[13] = from[7]; + to[14] = from[11]; + to[15] = from[15]; +} + + + +void gl_matrix_transposed( GLdouble to[16], const GLdouble from[16] ) +{ + to[0] = from[0]; + to[1] = from[4]; + to[2] = from[8]; + to[3] = from[12]; + to[4] = from[1]; + to[5] = from[5]; + to[6] = from[9]; + to[7] = from[13]; + to[8] = from[2]; + to[9] = from[6]; + to[10] = from[10]; + to[11] = from[14]; + to[12] = from[3]; + to[13] = from[7]; + to[14] = from[11]; + to[15] = from[15]; +} + + + /* * Generate a 4x4 transformation matrix from glRotate parameters. */ @@ -1331,6 +1375,42 @@ _mesa_Translated( GLdouble x, GLdouble y, GLdouble z ) +void +_mesa_LoadTransposeMatrixfARB( const GLfloat *m ) +{ + GLfloat tm[16]; + gl_matrix_transposef(tm, m); + _mesa_LoadMatrixf(tm); +} + + +void +_mesa_LoadTransposeMatrixdARB( const GLdouble *m ) +{ + GLdouble tm[16]; + gl_matrix_transposed(tm, m); + _mesa_LoadMatrixd(tm); +} + + +void +_mesa_MultTransposeMatrixfARB( const GLfloat *m ) +{ + GLfloat tm[16]; + gl_matrix_transposef(tm, m); + _mesa_MultMatrixf(tm); +} + + +void +_mesa_MultTransposeMatrixdARB( const GLdouble *m ) +{ + GLdouble tm[16]; + gl_matrix_transposed(tm, m); + _mesa_MultMatrixd(tm); +} + + /* * Called via glViewport or display list execution. */ |