summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-02-24 16:10:52 +0000
committerBrian Paul <[email protected]>2004-02-24 16:10:52 +0000
commit8d407300c2b94f32c955b6dd75c2e18d6d58caa5 (patch)
treeb80129ebb67942822ce0a3236cfaf90cd811265b
parent4d5dddd125ec99f25bc0abafcca90033392a100e (diff)
turns out we probably need a _tnl_allow_pixel_fog() function afterall
-rw-r--r--src/mesa/tnl/t_context.c12
-rw-r--r--src/mesa/tnl/t_context.h1
-rw-r--r--src/mesa/tnl/tnl.h3
3 files changed, 15 insertions, 1 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 626aa5290e6..2c529afd79e 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -103,6 +103,7 @@ _tnl_CreateContext( GLcontext *ctx )
tnl->LoopbackDListCassettes = GL_FALSE;
tnl->CalcDListNormalLengths = GL_TRUE;
tnl->AllowVertexFog = GL_TRUE;
+ tnl->AllowPixelFog = GL_TRUE;
/* Hook our functions into exec and compile dispatch tables.
*/
@@ -146,7 +147,9 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
TNLcontext *tnl = TNL_CONTEXT(ctx);
if (new_state & (_NEW_HINT)) {
- tnl->_DoVertexFog = tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST);
+ ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog);
+ tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+ || !tnl->AllowPixelFog;
}
if (new_state & _NEW_ARRAY) {
@@ -272,3 +275,10 @@ _tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value )
tnl->AllowVertexFog = value;
}
+void
+_tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ tnl->AllowPixelFog = value;
+}
+
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h
index b7aff6c6266..e7f561305a0 100644
--- a/src/mesa/tnl/t_context.h
+++ b/src/mesa/tnl/t_context.h
@@ -705,6 +705,7 @@ typedef struct
GLboolean CalcDListNormalLengths;
GLboolean IsolateMaterials;
GLboolean AllowVertexFog;
+ GLboolean AllowPixelFog;
GLboolean _DoVertexFog; /* eval fog function at each vertex? */
diff --git a/src/mesa/tnl/tnl.h b/src/mesa/tnl/tnl.h
index 3be222a6e02..d04310fb53e 100644
--- a/src/mesa/tnl/tnl.h
+++ b/src/mesa/tnl/tnl.h
@@ -80,5 +80,8 @@ _tnl_isolate_materials( GLcontext *ctx, GLboolean flag );
extern void
_tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value );
+extern void
+_tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value );
+
#endif