-/* $Id: matrix.c,v 1.15 2000/02/21 23:00:51 brianp Exp $ */
+/* $Id: matrix.c,v 1.17 2000/04/08 18:57:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
mat = &ctx->TextureMatrix[ctx->Texture.CurrentTransformUnit]; \
flags |= NEW_TEXTURE_MATRIX; \
break; \
+ case GL_COLOR: \
+ mat = &ctx->ColorMatrix; \
+ flags |= NEW_COLOR_MATRIX; \
+ break; \
default: \
gl_problem(ctx, where); \
} \
case GL_MODELVIEW:
case GL_PROJECTION:
case GL_TEXTURE:
+ case GL_COLOR:
ctx->Transform.MatrixMode = mode;
break;
default:
&ctx->TextureMatrix[t] );
}
break;
+ case GL_COLOR:
+ if (ctx->ColorStackDepth >= MAX_COLOR_STACK_DEPTH - 1) {
+ gl_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix");
+ return;
+ }
+ gl_matrix_copy( &ctx->ColorStack[ctx->ColorStackDepth++],
+ &ctx->ColorMatrix );
+ break;
default:
gl_problem(ctx, "Bad matrix mode in gl_PushMatrix");
}
&ctx->TextureStack[t][--ctx->TextureStackDepth[t]]);
}
break;
+ case GL_COLOR:
+ if (ctx->ColorStackDepth==0) {
+ gl_error( ctx, GL_STACK_UNDERFLOW, "glPopMatrix");
+ return;
+ }
+ gl_matrix_copy(&ctx->ColorMatrix,
+ &ctx->ColorStack[--ctx->ColorStackDepth]);
+ break;
default:
gl_problem(ctx, "Bad matrix mode in gl_PopMatrix");
}
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.m[MAT_SZ] = 0.5 * ctx->Visual->DepthMaxF;
+ ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual->DepthMaxF;
ctx->Viewport.WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
ctx->Viewport.WindowMap.type = MATRIX_3D_NO_ROT;
ctx->Viewport.Near = n;
ctx->Viewport.Far = f;
- ctx->Viewport.WindowMap.m[MAT_SZ] = DEPTH_SCALE * ((f - n) / 2.0);
- ctx->Viewport.WindowMap.m[MAT_TZ] = DEPTH_SCALE * ((f - n) / 2.0 + n);
+ ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0);
+ ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0 + n);
ctx->ModelProjectWinMatrixUptodate = GL_FALSE;