From: Brian Paul Date: Wed, 12 Aug 2009 19:44:43 +0000 (-0600) Subject: mesa: new _mesa_is_bufferobj() function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=abbf83551f2ec1d168c3f8449eeed8dad7b394b8;p=mesa.git mesa: new _mesa_is_bufferobj() function Tests if the given buffer object is a user-created, non-default buffer object. Use this instead of testing bufferobj->Name != 0. --- diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 3678fba435e..c68291ab919 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -44,6 +44,18 @@ _mesa_bufferobj_mapped(struct gl_buffer_object *obj) return obj->Pointer != NULL; } +/** + * Is the given buffer object a user-created buffer object? + * Mesa uses default buffer objects in several places. Default buffers + * always have Name==0. User created buffers have Name!=0. + */ +static INLINE GLboolean +_mesa_is_bufferobj(struct gl_buffer_object *obj) +{ + return obj->Name != 0; +} + + extern void _mesa_init_buffer_objects( GLcontext *ctx );