From 9b7c843671144caf26cdff4341a2abaf1e31b325 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sun, 5 Sep 1999 19:59:33 +0000 Subject: fixes for the mga driver --- src/mesa/main/matrix.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index c6459947fe..6a72da9acf 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) { -- cgit v1.2.3