summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/state.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/state.h')
-rw-r--r--src/mesa/main/state.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/state.h b/src/mesa/main/state.h
index 8817a4776d1..6d81c3f421b 100644
--- a/src/mesa/main/state.h
+++ b/src/mesa/main/state.h
@@ -83,4 +83,14 @@ _mesa_vertex_program_two_side_enabled(const struct gl_context *ctx)
return ctx->Light.Enabled && ctx->Light.Model.TwoSide;
}
+/** Return 0=GL_CCW or 1=GL_CW */
+static inline bool
+_mesa_polygon_get_front_bit(const struct gl_context *ctx)
+{
+ if (ctx->Transform.ClipOrigin == GL_LOWER_LEFT)
+ return ctx->Polygon.FrontFace == GL_CW;
+
+ return ctx->Polygon.FrontFace == GL_CCW;
+}
+
#endif