summaryrefslogtreecommitdiff
path: root/src/mesa/main/light.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/light.c')
-rw-r--r--src/mesa/main/light.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 6e057614ba..6dd334e16d 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -53,6 +53,11 @@ _mesa_ShadeModel( GLenum mode )
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.ShadeModel = mode;
+ if (mode == GL_FLAT)
+ ctx->_TriangleCaps |= DD_FLATSHADE;
+ else
+ ctx->_TriangleCaps &= ~DD_FLATSHADE;
+
if (ctx->Driver.ShadeModel)
ctx->Driver.ShadeModel( ctx, mode );
}
@@ -441,6 +446,10 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Model.TwoSide = newbool;
+ if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
+ ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
+ else
+ ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
break;
case GL_LIGHT_MODEL_COLOR_CONTROL:
if (params[0] == (GLfloat) GL_SINGLE_COLOR)