-/* $Id: attrib.c,v 1.75 2002/10/24 23:57:19 brianp Exp $ */
+/* $Id: attrib.c,v 1.76 2003/01/22 17:58:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 5.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#include "blend.h"
#include "buffers.h"
#include "colormac.h"
+#include "colortab.h"
#include "context.h"
#include "depth.h"
#include "enable.h"
attr->Blend = ctx->Color.BlendEnabled;
attr->ClipPlanes = ctx->Transform.ClipPlanesEnabled;
attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
+ attr->ColorTable = ctx->Pixel.ColorTableEnabled;
+ attr->PostColorMatrixColorTable = ctx->Pixel.PostColorMatrixColorTableEnabled;
+ attr->PostConvolutionColorTable = ctx->Pixel.PostConvolutionColorTableEnabled;
attr->Convolution1D = ctx->Pixel.Convolution1DEnabled;
attr->Convolution2D = ctx->Pixel.Convolution2DEnabled;
attr->Separable2D = ctx->Pixel.Separable2DEnabled;
attr->Texture[i] = ctx->Texture.Unit[i].Enabled;
attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled;
}
+ attr->TextureColorTable = ctx->Texture.ColorTableEnabled;
/* GL_NV_vertex_program */
attr->VertexProgram = ctx->VertexProgram.Enabled;
attr->VertexProgramPointSize = ctx->VertexProgram.PointSizeEnabled;
TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial,
GL_COLOR_MATERIAL);
+ TEST_AND_UPDATE(ctx->Pixel.ColorTableEnabled, enable->ColorTable,
+ GL_COLOR_TABLE);
+ TEST_AND_UPDATE(ctx->Pixel.PostColorMatrixColorTableEnabled,
+ enable->PostColorMatrixColorTable,
+ GL_POST_COLOR_MATRIX_COLOR_TABLE);
+ TEST_AND_UPDATE(ctx->Pixel.PostConvolutionColorTableEnabled,
+ enable->PostConvolutionColorTable,
+ GL_POST_CONVOLUTION_COLOR_TABLE);
TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
TEST_AND_UPDATE(ctx->Multisample.SampleCoverageInvert,
enable->SampleCoverageInvert,
GL_SAMPLE_COVERAGE_INVERT_ARB);
+ TEST_AND_UPDATE(ctx->Texture.ColorTableEnabled, enable->TextureColorTable,
+ GL_TEXTURE_COLOR_TABLE_SGI);
/* GL_NV_vertex_program */
TEST_AND_UPDATE(ctx->VertexProgram.Enabled,
enable->VertexProgram,
_mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_NV,
(GLboolean) (unit->Enabled & TEXTURE_RECT_BIT ? GL_TRUE : GL_FALSE));
}
+ if (ctx->Extensions.SGI_texture_color_table) {
+ _mesa_set_enable(ctx, GL_TEXTURE_COLOR_TABLE_SGI,
+ texAttrib->ColorTableEnabled);
+ _mesa_ColorTableParameterfv(GL_TEXTURE_COLOR_TABLE_SGI,
+ GL_COLOR_TABLE_SCALE_SGI,
+ texAttrib->ColorTableScale);
+ _mesa_ColorTableParameterfv(GL_TEXTURE_COLOR_TABLE_SGI,
+ GL_COLOR_TABLE_BIAS_SGI,
+ texAttrib->ColorTableBias);
+ }
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode);
_mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor);
_mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenModeS);
-/* $Id: mtypes.h,v 1.100 2003/01/21 21:47:50 brianp Exp $ */
+/* $Id: mtypes.h,v 1.101 2003/01/22 17:58:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLboolean Blend;
GLuint ClipPlanes;
GLboolean ColorMaterial;
+ GLboolean ColorTable; /* SGI_color_table */
+ GLboolean PostColorMatrixColorTable; /* SGI_color_table */
+ GLboolean PostConvolutionColorTable; /* SGI_color_table */
GLboolean Convolution1D;
GLboolean Convolution2D;
GLboolean Separable2D;
GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
GLuint Texture[MAX_TEXTURE_IMAGE_UNITS];
GLuint TexGen[MAX_TEXTURE_COORD_UNITS];
+ GLboolean TextureColorTable; /* SGI_texture_color_table */
GLboolean VertexProgram; /* GL_NV_vertex_program */
GLboolean VertexProgramPointSize; /* GL_NV_vertex_program */
GLboolean VertexProgramTwoSide; /* GL_NV_vertex_program */