From 29b4076f9acff96a867760fc885f5eaeb7586977 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 Sep 2003 23:21:08 +0000 Subject: Move away from using the ctx->_TriangleCaps bitfield. New macros in context.h for testing state: NEED_SECONDARY_COLOR and NEED_TWO_SIDED_LIGHTING. --- src/mesa/main/context.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/mesa/main') diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index be65be8214..78b2179627 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -361,4 +361,30 @@ do { \ /*@}*/ + +/** + * Macros to help evaluate current state conditions + */ + +/*@{*/ + +/** + * Is the secondary color needed? + */ +#define NEED_SECONDARY_COLOR(CTX) \ + (((CTX)->Light.Enabled && \ + (CTX)->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) \ + || (CTX)->Fog.ColorSumEnabled) + + +/** + * Is two-sided lighting in effect? + */ +#define NEED_TWO_SIDED_LIGHTING(CTX) \ + (ctx->Light.Enabled && ctx->Light.Model.TwoSide) + + +/*@}*/ + + #endif -- cgit v1.2.3