Class Buffer<T>
A buffer with typed information.
public class Buffer<T> : Buffer, IDisposable, IComponent, IReferencable, ICollectorHolder where T : unmanaged
Type Parameters
T
Type of an element of this buffer.
- Inheritance
-
Buffer<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
Buffer(GraphicsDevice, BufferDescription, BufferFlags, PixelFormat, IntPtr)
protected Buffer(GraphicsDevice device, BufferDescription description, BufferFlags viewFlags, PixelFormat viewFormat, IntPtr dataPointer)
Parameters
device
GraphicsDevice description
BufferDescription viewFlags
BufferFlags viewFormat
PixelFormat dataPointer
IntPtr
Fields
ElementSize
Gets the size of element T.
Field Value
Methods
GetData(CommandList)
Gets the content of this texture to an array of data.
Parameters
commandList
CommandList
Returns
- T[]
An array of data.
Remarks
This method is only working when called from the main thread that is accessing the main Graphics
SetData(CommandList, ref T, int)
Copies the content of a single structure data from CPU memory to this buffer into GPU memory.
Parameters
commandList
CommandList fromData
TThe data to copy from.
offsetInBytes
intThe offset in bytes to write to.
Remarks
This method is only working when called from the main thread that is accessing the main Graphics
Exceptions
SetData(CommandList, T[], int)
Copies the content an array of data from CPU memory to this buffer into GPU memory.
Parameters
commandList
CommandList fromData
T[]The data to copy from.
offsetInBytes
intThe offset in bytes to write to.
Remarks
This method is only working when called from the main thread that is accessing the main Graphics