From cd96388857255711c4e33e7d2626f199d3810d15 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 10 Dec 1999 20:01:06 +0000 Subject: implemented GL_ARB_tranpose_matrix --- src/mesa/main/matrix.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/matrix.c') diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index afd33ed015..a86c0d3d6f 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. */ -- cgit v1.2.3