summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-09-18 23:21:08 +0000
committerBrian Paul <[email protected]>2003-09-18 23:21:08 +0000
commit29b4076f9acff96a867760fc885f5eaeb7586977 (patch)
tree8257664555bea58b6f9f2ebc4e3d0f2ddce719c3 /src/mesa/main/context.h
parent1a8ebb8c2f939609004a13b75d2b85236e709716 (diff)
Move away from using the ctx->_TriangleCaps bitfield.
New macros in context.h for testing state: NEED_SECONDARY_COLOR and NEED_TWO_SIDED_LIGHTING.
Diffstat (limited to 'src/mesa/main/context.h')
-rw-r--r--src/mesa/main/context.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index be65be82147..78b21796272 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