summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2012-07-19 11:01:27 -0700
committerJordan Justen <jordan.l.justen@intel.com>2012-07-24 15:41:59 -0700
commitcbc697433011bf048f4176335844051c4c661d61 (patch)
treea7846f22093f51dc9b607f74d8593980bc3a4609 /src/mesa
parentf7a395f9707d1f883f54df4794b90c7eb54e92dd (diff)
mesa: add api check macros
These macros make it easier to check for multiple API types. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/mtypes.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7d779565e49..7a715b3b9d7 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.
*