summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.h
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2012-07-19 11:01:27 -0700
committerJordan Justen <jordan.l.justen@intel.com>2012-07-30 16:18:57 -0700
commit3d284dcba6f692ce268c9a2178a30e7a308b2cfc (patch)
treed781ec86d1145c2a4b108ffb0b9fceb1379c546e /src/mesa/main/context.h
parent1c29b73f4d9f633e32c03bebc8d505b321d833d9 (diff)
downloadexternal_mesa3d-3d284dcba6f692ce268c9a2178a30e7a308b2cfc.zip
external_mesa3d-3d284dcba6f692ce268c9a2178a30e7a308b2cfc.tar.gz
external_mesa3d-3d284dcba6f692ce268c9a2178a30e7a308b2cfc.tar.bz2
mesa: add api check functions
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>
Diffstat (limited to 'src/mesa/main/context.h')
-rw-r--r--src/mesa/main/context.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index a66dd50..6b7dafa 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -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