Mesa (master): mesa: new _mesa_is_bufferobj() function
Brian Paul
brianp at kemper.freedesktop.org
Wed Aug 12 23:31:57 UTC 2009
Module: Mesa
Branch: master
Commit: abbf83551f2ec1d168c3f8449eeed8dad7b394b8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=abbf83551f2ec1d168c3f8449eeed8dad7b394b8
Author: Brian Paul <brianp at vmware.com>
Date: Wed Aug 12 13:44:43 2009 -0600
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 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 3678fba..c68291a 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 );
More information about the mesa-commit
mailing list