From: Jordan Justen Date: Thu, 19 Jul 2012 18:01:27 +0000 (-0700) Subject: mesa: add api check functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d284dcba6f692ce268c9a2178a30e7a308b2cfc;p=mesa.git mesa: add api check functions These functions make it easier to check for multiple API types. Signed-off-by: Jordan Justen Reviewed-by: Brian Paul Reviewed-by: Eric Anholt Reviewed-by: Ian Romanick --- diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index a66dd507670..6b7dafa782a 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -290,6 +290,26 @@ 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; +} + + #ifdef __cplusplus } #endif