aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/context.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/context.h')
-rw-r--r--mesalib/src/mesa/main/context.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/context.h b/mesalib/src/mesa/main/context.h
index a66dd5076..6b7dafa78 100644
--- a/mesalib/src/mesa/main/context.h
+++ b/mesalib/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