mesa: add api check functions
authorJordan Justen <jordan.l.justen@intel.com>
Thu, 19 Jul 2012 18:01:27 +0000 (11:01 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Mon, 30 Jul 2012 23:18:57 +0000 (16:18 -0700)
These functions make it easier to check for multiple API types.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/context.h

index a66dd507670cd1c365df5c9d2e320a8ab67c56c1..6b7dafa782aa253cfe3dc029dfe3d36daea41de3 100644 (file)
@@ -290,6 +290,26 @@ do {                                                                       \
 /*@}*/
 
 
+/**
+ * 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
 }
 #endif