mesa: add api check functions

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

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Jordan Justen 2012-07-19 11:01:27 -07:00
parent 1c29b73f4d
commit 3d284dcba6

View file

@ -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