summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/matrix.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>1999-09-05 19:59:33 +0000
committerKeith Whitwell <[email protected]>1999-09-05 19:59:33 +0000
commit9b7c843671144caf26cdff4341a2abaf1e31b325 (patch)
treec038a0c939d11006542b602fafd23c40141f887a /src/mesa/main/matrix.c
parent324beb95f34b29b53c8863af5591fb90393a157e (diff)
fixes for the mga driver
Diffstat (limited to 'src/mesa/main/matrix.c')
-rw-r--r--src/mesa/main/matrix.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index c6459947fe5..6a72da9acf7 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -1,4 +1,4 @@
-/* $Id: matrix.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: matrix.c,v 1.2 1999/09/05 19:59:33 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -1311,6 +1311,11 @@ void gl_Viewport( GLcontext *ctx,
ctx->Viewport.WindowMap.m[MAT_TX] = ctx->Viewport.WindowMap.m[MAT_SX] + x;
ctx->Viewport.WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F;
ctx->Viewport.WindowMap.m[MAT_TY] = ctx->Viewport.WindowMap.m[MAT_SY] + y;
+ ctx->Viewport.WindowMap.m[MAT_SZ] = 0.5 * DEPTH_SCALE;
+ ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * DEPTH_SCALE;
+
+ ctx->Viewport.WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
+ ctx->Viewport.WindowMap.type = MATRIX_3D_NO_ROT;
ctx->ModelProjectWinMatrixUptodate = GL_FALSE;
ctx->NewState |= NEW_VIEWPORT;
@@ -1400,6 +1405,14 @@ void gl_matrix_dtr( GLmatrix *m )
}
}
+void gl_matrix_set_identity( GLmatrix *m )
+{
+ MEMCPY( m->m, Identity, sizeof(Identity));
+ m->type = MATRIX_IDENTITY;
+ m->flags = MAT_DIRTY_DEPENDENTS;
+}
+
+
void gl_matrix_alloc_inv( GLmatrix *m )
{
if (m->inv == 0) {