Class Buffer.Index
Helper methods for creating Index Buffers.
public static class Buffer.Index
- Inheritance
-
objectBuffer.Index
Remarks
An Index Buffer is a Buffer that stores indices that reference vertices in a Vertex Buffer. They are used for efficient rendering of triangle lists / strip. They are, however, limited to only 16-bit or 32-bit values.
Methods
New(GraphicsDevice, DataPointer, GraphicsResourceUsage)
Creates a new Index Buffer.
[Obsolete("This method is obsolete. Use the span-based methods instead")]
public static Buffer New(GraphicsDevice device, DataPointer dataPointer, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
dataPointerDataPointerThe data pointer to the data to initialize the Index Buffer.
usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Immutable.
Returns
New(GraphicsDevice, byte[], bool, GraphicsResourceUsage)
Creates a new Index Buffer with initial data.
public static Buffer New(GraphicsDevice device, byte[] data, bool is32BitIndex, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
databyte[]The data to initialize the Index Buffer.
is32BitIndexbooltrue if the Buffer will use 32-bit indices; false for using 16-bit indices.
usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Immutable.
Returns
New(GraphicsDevice, int, GraphicsResourceUsage)
Creates a new Index Buffer of a given size.
public static Buffer New(GraphicsDevice device, int bufferSize, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
bufferSizeintSize of the Buffer in bytes.
usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Default.
Returns
New(GraphicsDevice, ReadOnlySpan<byte>, GraphicsResourceUsage)
Creates a new Index Buffer with initial data.
public static Buffer New(GraphicsDevice device, ReadOnlySpan<byte> data, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
dataReadOnlySpan<byte>The data to initialize the Index Buffer.
usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Immutable.
Returns
New<T>(GraphicsDevice, GraphicsResourceUsage)
Creates a new Index Buffer.
public static Buffer<T> New<T>(GraphicsDevice device, GraphicsResourceUsage usage = GraphicsResourceUsage.Default) where T : unmanaged
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Default.
Returns
Type Parameters
New<T>(GraphicsDevice, ref readonly T, GraphicsResourceUsage)
Creates a new Index Buffer with initial data.
public static Buffer<T> New<T>(GraphicsDevice device, ref readonly T value, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable) where T : unmanaged
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
valueTThe value to initialize the Index Buffer.
usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Immutable.
Returns
Type Parameters
New<T>(GraphicsDevice, T[], GraphicsResourceUsage)
Creates a new Index Buffer with initial data.
public static Buffer<T> New<T>(GraphicsDevice device, T[] data, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable) where T : unmanaged
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
dataT[]The data to initialize the Index Buffer.
usageGraphicsResourceUsageThe usage for the Buffer, which determines who can read/write data. By default, it is Immutable.