summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/lines.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2000-10-30 13:31:59 +0000
committerKeith Whitwell <[email protected]>2000-10-30 13:31:59 +0000
commita96308c37db0bc0086a017d318bc3504aa5f0b1a (patch)
tree0010de3aa19901acf13b57e57e7ba465abffa95e /src/mesa/main/lines.c
parenta4575499679d9d91055a35c7673b81872ec127cb (diff)
Replace the flags Mesa was using for ctx->NewState with a new set
based on the GL attribute groups. Introduced constants describing the circumstances under which some key derived values can change: _SWRAST_NEW_RASTERMASK -- ctx->RasterMask _SWRAST_NEW_TRIANGLE -- The software rasterizer's triangle function _DD_NEW_FEEDBACK -- the 'DD_FEEDBACK' bit in ctx->TriangleCaps These are helpful in deciding whether you need to recalculate state if your recalculation involves reference to a derived value.
Diffstat (limited to 'src/mesa/main/lines.c')
-rw-r--r--src/mesa/main/lines.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
index df1be60a4b2..f3255601ca8 100644
--- a/src/mesa/main/lines.c
+++ b/src/mesa/main/lines.c
@@ -1,4 +1,4 @@
-/* $Id: lines.c,v 1.18 2000/10/28 18:34:48 brianp Exp $ */
+/* $Id: lines.c,v 1.19 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -57,7 +57,9 @@ _mesa_LineWidth( GLfloat width )
ctx->Line.Width = width;
ctx->TriangleCaps &= ~DD_LINE_WIDTH;
if (width != 1.0) ctx->TriangleCaps |= DD_LINE_WIDTH;
- ctx->NewState |= NEW_RASTER_OPS;
+
+ ctx->NewState |= _NEW_LINE;
+
if (ctx->Driver.LineWidth)
(*ctx->Driver.LineWidth)(ctx, width);
}
@@ -72,7 +74,8 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLineStipple");
ctx->Line.StippleFactor = CLAMP( factor, 1, 256 );
ctx->Line.StipplePattern = pattern;
- ctx->NewState |= NEW_RASTER_OPS;
+
+ ctx->NewState |= _NEW_LINE;
if (ctx->Driver.LineStipple)
ctx->Driver.LineStipple( ctx, factor, pattern );
@@ -1099,6 +1102,9 @@ _mesa_print_line_function(GLcontext *ctx)
/*
* Determine which line drawing function to use given the current
* rendering context.
+ *
+ * Please update the summary flag _SWRAST_NEW_LINE if you add or remove
+ * tests to this code.
*/
void gl_set_line_function( GLcontext *ctx )
{
@@ -1136,7 +1142,8 @@ void gl_set_line_function( GLcontext *ctx )
}
else if (ctx->Texture.ReallyEnabled) {
if (ctx->Texture.MultiTextureEnabled
- || ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) {
+ || ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR
+ || ctx->Fog.ColorSumEnabled) {
/* multi-texture and/or separate specular color */
if (ctx->Light.ShadeModel==GL_SMOOTH)
ctx->Driver.LineFunc = smooth_multitextured_line;