/// <summary>
        ///     Copy data from another buffer into this one.
        /// </summary>
        /// <param name="srcBuffer">The buffer from which to read the copied data.</param>
        /// <param name="srcOffset">Offset in the source buffer at which to start reading.</param>
        /// <param name="destOffset">Offset in the destination buffer to start writing.</param>
        /// <param name="length">Length of the data to copy, in bytes.</param>
        /// <param name="discardWholeBuffer">If true, will discard the entire contents of this buffer before copying.</param>
        public virtual void CopyData(HardwareBuffer srcBuffer, int srcOffset, int destOffset, int length, bool discardWholeBuffer)
        {
            // lock the source buffer
            IntPtr srcData = srcBuffer.Lock(srcOffset, length, BufferLocking.ReadOnly);

            // write the data to this buffer
            this.WriteData(destOffset, length, srcData, discardWholeBuffer);

            // unlock the source buffer
            srcBuffer.Unlock();
        }
        /// <summary>
        ///		Must be called after a call to <code>Lock</code>.  Unlocks the vertex buffer in the hardware
        ///		memory.
        /// </summary>
        public virtual void Unlock()
        {
            Debug.Assert(this.IsLocked, "Cannot unlock this buffer if it isn't locked to begin with.");

            if (useShadowBuffer && shadowBuffer.IsLocked)
            {
                shadowBuffer.Unlock();

                // potentially update the real buffer from the shadow buffer
                UpdateFromShadow();
            }
            else
            {
                // unlock the real deal
                this.UnlockImpl();

                isLocked = false;
            }
        }
        /// <summary>
        ///     Copy data from another buffer into this one.
        /// </summary>
        /// <param name="srcBuffer">The buffer from which to read the copied data.</param>
        /// <param name="srcOffset">Offset in the source buffer at which to start reading.</param>
        /// <param name="destOffset">Offset in the destination buffer to start writing.</param>
        /// <param name="length">Length of the data to copy, in bytes.</param>
        /// <param name="discardWholeBuffer">If true, will discard the entire contents of this buffer before copying.</param>
        public virtual void CopyData(HardwareBuffer srcBuffer, int srcOffset, int destOffset, int length, bool discardWholeBuffer)
        {
            // lock the source buffer
            IntPtr srcData = srcBuffer.Lock(srcOffset, length, BufferLocking.ReadOnly);

            // write the data to this buffer
            this.WriteData(destOffset, length, srcData, discardWholeBuffer);

            // unlock the source buffer
            srcBuffer.Unlock();
        }