[Mesa-dev] [PATCH v2 2/7] mesa: add api check macros
Jordan Justen
jordan.l.justen at intel.com
Thu Jul 26 23:43:34 PDT 2012
These macros make it easier to check for multiple API types.
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
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
More information about the mesa-dev
mailing list