mesa: Pass GL context to _mesa_create_save_table
[mesa.git] / src / mesa / main / context.h
index a66dd507670cd1c365df5c9d2e320a8ab67c56c1..e2387521f57879c649596c95937f4a9f7f47f8e8 100644 (file)
@@ -290,6 +290,36 @@ 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;
+}
+
+
+/**
+ * Checks if the context is for GLES 3.x
+ */
+static inline GLboolean
+_mesa_is_gles3(const struct gl_context *ctx)
+{
+   return ctx->API == API_OPENGLES2 && ctx->Version >= 30;
+}
+
+
 #ifdef __cplusplus
 }
 #endif