These macros make it easier to check for multiple API types.

Signed-off-by: Jordan Justen <[email protected]>
---
 src/mesa/main/mtypes.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7d77956..7a715b3 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3340,6 +3340,10 @@ typedef enum
    API_OPENGL_CORE,
 } gl_api;
 
+#define IS_CTX_IN2(ctx, api1, api2) ((ctx->API == api1) || (ctx->API == api2))
+#define IS_CTX_DESKTOP_GL(ctx) IS_CTX_IN2(ctx, API_OPENGL, API_OPENGL_CORE)
+#define IS_CTX_GLES(ctx) IS_CTX_IN2(ctx, API_OPENGLES, API_OPENGLES2)
+
 /**
  * Driver-specific state flags.
  *
-- 
1.7.9.5

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to