summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-06-23 17:09:32 +0200
committerSamuel Pitoiset <[email protected]>2017-06-28 10:25:12 +0200
commitac92b750022567c64c7ed72db3eaefe15ba670cd (patch)
tree221996fa6d1a97594280892928fdd1722ccd2422
parent03dc92ad97e737836f5752b8121f04220322ee77 (diff)
mesa: add cull_face() helper
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r--src/mesa/main/polygon.c33
-rw-r--r--src/mesa/main/polygon.h2
2 files changed, 21 insertions, 14 deletions
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index 03c63628dfc..13dca6d39cf 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -50,19 +50,9 @@
* change, flushes the vertices and notifies the driver via
* the dd_function_table::CullFace callback.
*/
-void GLAPIENTRY
-_mesa_CullFace( GLenum mode )
+static void
+cull_face(struct gl_context *ctx, GLenum mode)
{
- GET_CURRENT_CONTEXT(ctx);
-
- if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glCullFace %s\n", _mesa_enum_to_string(mode));
-
- if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
- return;
- }
-
if (ctx->Polygon.CullFaceMode == mode)
return;
@@ -71,7 +61,24 @@ _mesa_CullFace( GLenum mode )
ctx->Polygon.CullFaceMode = mode;
if (ctx->Driver.CullFace)
- ctx->Driver.CullFace( ctx, mode );
+ ctx->Driver.CullFace(ctx, mode);
+}
+
+
+void GLAPIENTRY
+_mesa_CullFace(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glCullFace %s\n", _mesa_enum_to_string(mode));
+
+ if (mode != GL_FRONT && mode != GL_BACK && mode != GL_FRONT_AND_BACK) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCullFace");
+ return;
+ }
+
+ cull_face(ctx, mode);
}
diff --git a/src/mesa/main/polygon.h b/src/mesa/main/polygon.h
index 41344a2ef0c..ceca848d6d4 100644
--- a/src/mesa/main/polygon.h
+++ b/src/mesa/main/polygon.h
@@ -40,7 +40,7 @@ extern void GLAPIENTRY
_mesa_GetnPolygonStippleARB( GLsizei bufSize, GLubyte *dest );
extern void GLAPIENTRY
-_mesa_CullFace( GLenum mode );
+_mesa_CullFace(GLenum mode);
extern void GLAPIENTRY
_mesa_FrontFace( GLenum mode );