summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-08-12 13:44:43 -0600
committerBrian Paul <[email protected]>2009-08-12 17:28:45 -0600
commitabbf83551f2ec1d168c3f8449eeed8dad7b394b8 (patch)
treec527c8cf26140a9492c9737d8f6fb7a21bb95134 /src/mesa/main/bufferobj.h
parentd64649a316858a390bafe2aa619be3cf2c98ffde (diff)
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.
Diffstat (limited to 'src/mesa/main/bufferobj.h')
-rw-r--r--src/mesa/main/bufferobj.h12
1 files changed, 12 insertions, 0 deletions
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 );