Move away from using the ctx->_TriangleCaps bitfield.

New macros in context.h for testing state: NEED_SECONDARY_COLOR
and NEED_TWO_SIDED_LIGHTING.
This commit is contained in:
Brian Paul
2003-09-18 23:21:08 +00:00
parent 1a8ebb8c2f
commit 29b4076f9a
7 changed files with 50 additions and 19 deletions

View File

@@ -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