Click or drag to resize

DataBufferSubDataT Method (IntPtr, T)

Update a subset of a buffer object's data store.

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public void SubData<T>(
	IntPtr offset,
	T[] data
)
where T : struct, new()

Parameters

offset
Type: SystemIntPtr
the offset into the buffer object's data store where data replacement will begin, measured in bytes.
data
Type: T
data array to copy to the buffer.

Type Parameters

T
the type of data in the data array
Exceptions
ExceptionCondition
GLExceptionInvalidValue if offset is negative, or if together with the size of the data, they define a region of memory that extends beyond the buffer object's allocated data store.
GLExceptionInvalidOperation if no buffer is bound.
Remarks
This method redefines some or all of the data store for the buffer object currently bound to target. data starting at byte offset offset is copied to the data store from the memory pointed to by data. An error is thrown if offset and size together define a range beyond the bounds of the buffer object's data store.

Note: when replacing the entire data store, consider using SubData rather than completely recreating the data store with DataT(T, IntPtr, DataBufferUsage). This avoids the cost of reallocating the data store.

Note: consider using multiple buffer objects to avoid stalling the rendering pipeline during data store updates. If any rendering in the pipeline makes reference to data in the buffer object being updated by SubData, especially from the specific region being updated, that rendering must drain from the pipeline before the data store can be updated.

Note: clients must align data elements consistent with the requirements of the client platform, with an additional base-level requirement that an offset within a buffer to a datum comprising N be a multiple of N.

Note: in DEBUG mode with assertions enabled, an error will be logged to the debug console if this buffer is not bound.

Note: it is more efficient to use the overload SubDataT(IntPtr, T, IntPtr) instead.

OpenGL API: glBufferSubData

See Also