mesa: new _mesa_copy_client_array() function
authorBrian Paul <brianp@vmware.com>
Thu, 6 Aug 2009 19:53:06 +0000 (13:53 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 7 Aug 2009 15:50:38 +0000 (09:50 -0600)
src/mesa/main/varray.c
src/mesa/main/varray.h

index 88bf8d8d350bf0f7e99a9c90fbc240d51a8fbb96..be1c03cec2a88ac97e93f4bf628d3c256fe32650 100644 (file)
@@ -1098,6 +1098,29 @@ _mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count,
 }
 
 
+/**
+ * Copy one client vertex array to another.
+ */
+void
+_mesa_copy_client_array(GLcontext *ctx,
+                        struct gl_client_array *dst,
+                        struct gl_client_array *src)
+{
+   dst->Size = src->Size;
+   dst->Type = src->Type;
+   dst->Format = src->Format;
+   dst->Stride = src->Stride;
+   dst->StrideB = src->StrideB;
+   dst->Ptr = src->Ptr;
+   dst->Enabled = src->Enabled;
+   dst->Normalized = src->Normalized;
+   dst->_ElementSize = src->_ElementSize;
+   _mesa_reference_buffer_object(ctx, &dst->BufferObj, src->BufferObj);
+   dst->_MaxElement = src->_MaxElement;
+}
+
+
+
 /**
  * Print vertex array's fields.
  */
index d4d505ae049dfbb6ce7f748f3921be9e20441d33..becc67c29d34f840073f9b5c7a7208cf6b0b3259 100644 (file)
@@ -160,6 +160,12 @@ _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
                         GLenum type, const GLvoid *indices);
 
 
+extern void
+_mesa_copy_client_array(GLcontext *ctx,
+                        struct gl_client_array *dst,
+                        struct gl_client_array *src);
+
+
 extern void
 _mesa_print_arrays(GLcontext *ctx);