turns out we probably need a _tnl_allow_pixel_fog() function afterall
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 24 Feb 2004 16:10:52 +0000 (16:10 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 24 Feb 2004 16:10:52 +0000 (16:10 +0000)
src/mesa/tnl/t_context.c
src/mesa/tnl/t_context.h
src/mesa/tnl/tnl.h

index 626aa52..2c529af 100644 (file)
@@ -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;
+}
+
index b7aff6c..e7f5613 100644 (file)
@@ -705,6 +705,7 @@ typedef struct
    GLboolean CalcDListNormalLengths;
    GLboolean IsolateMaterials;
    GLboolean AllowVertexFog;
+   GLboolean AllowPixelFog;
 
    GLboolean _DoVertexFog;  /* eval fog function at each vertex? */
 
index 3be222a..d04310f 100644 (file)
@@ -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