mesa: Pass GL context to _mesa_create_save_table
[mesa.git] / src / mesa / main / context.h
index a9df0a866a7f0cb1fe0cb33346fb88acdb670f36..e2387521f57879c649596c95937f4a9f7f47f8e8 100644 (file)
 #include "mtypes.h"
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 struct _glapi_table;
 
 
@@ -285,5 +290,39 @@ 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
+
 
 #endif /* CONTEXT_H */