[Mesa-dev] [PATCH v4 2/7] mesa: add api check functions

Jordan Justen jordan.l.justen at intel.com
Fri Jul 27 14:45:10 PDT 2012


These functions make it easier to check for multiple API types.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/main/mtypes.h |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7d7213f..0730ff3 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3641,6 +3641,25 @@ enum _debug
 };
 
 
+/**
+ * Checks if the context is for Desktop GL (Compatibility or Core)
+ */
+static inline GLboolean
+_mesa_is_desktop_gl(const struct gl_context *ctx)
+{
+   return ctx->API == API_OPENGL || ctx->API == API_OPENGL_CORE;
+}
+
+
+/**
+ * Checks if the context is for any GLES version
+ */
+static inline GLboolean
+_mesa_is_gles(const struct gl_context *ctx)
+{
+   return ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2;
+}
+
 
 #ifdef __cplusplus
 }
-- 
1.7.9.5



More information about the mesa-dev mailing list