diff options
author | Brian Paul <[email protected]> | 2000-04-08 18:57:45 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2000-04-08 18:57:45 +0000 |
commit | 250069dbb443f26f4dcc409c9c873019a5f50f9d (patch) | |
tree | 605c5ed78350822c85fef87230b5a3999d02b208 /src/mesa/main/matrix.c | |
parent | a518b47e5bcff6e3feaeb378ccb06fd1ea1da760 (diff) |
added GL_SGI_color_matrix extension
Diffstat (limited to 'src/mesa/main/matrix.c')
-rw-r--r-- | src/mesa/main/matrix.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index c8f25c0cd5a..5eb5bb43f0c 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -1,4 +1,4 @@ -/* $Id: matrix.c,v 1.16 2000/03/03 17:47:39 brianp Exp $ */ +/* $Id: matrix.c,v 1.17 2000/04/08 18:57:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -931,6 +931,10 @@ do { \ 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); \ } \ @@ -1037,6 +1041,7 @@ _mesa_MatrixMode( GLenum mode ) case GL_MODELVIEW: case GL_PROJECTION: case GL_TEXTURE: + case GL_COLOR: ctx->Transform.MatrixMode = mode; break; default: @@ -1090,6 +1095,14 @@ _mesa_PushMatrix( void ) &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"); } @@ -1147,6 +1160,14 @@ _mesa_PopMatrix( void ) &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"); } |