[Mesa-dev] [PATCH v4 2/7] mesa: add api check functions

Brian Paul brianp at vmware.com
Fri Jul 27 14:53:57 PDT 2012


On 07/27/2012 03:45 PM, Jordan Justen wrote:
> These functions 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 |   19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
>
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 7d7213f..0730ff3 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -3641,6 +3641,25 @@ enum _debug
>   };
>
>
> +/**
> + * 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
>   }


I think a better home for these functions would be context.h

You don't need to repost the patch series just for that.

For the series: Reviewed-by: Brian Paul <brianp at vmware.com>

-Brian


More information about the mesa-dev mailing list