From abbf83551f2ec1d168c3f8449eeed8dad7b394b8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 12 Aug 2009 13:44:43 -0600 Subject: [PATCH] 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. --- src/mesa/main/bufferobj.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 ); -- 2.30.2