Table of Contents

Class Buffer.Index

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

Helper methods for creating Index Buffers.

public static class Buffer.Index
Inheritance
object
Buffer.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

device GraphicsDevice

The GraphicsDevice.

dataPointer DataPointer

The data pointer to the data to initialize the Index Buffer.

usage GraphicsResourceUsage

The usage for the Buffer, which determines who can read/write data. By default, it is Immutable.

Returns

Buffer

A new instance of Buffer.

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

device GraphicsDevice

The GraphicsDevice.

data byte[]

The data to initialize the Index Buffer.

is32BitIndex bool

true if the Buffer will use 32-bit indices; false for using 16-bit indices.

usage GraphicsResourceUsage

The usage for the Buffer, which determines who can read/write data. By default, it is Immutable.

Returns

Buffer

A new instance of Buffer.

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

device GraphicsDevice

The GraphicsDevice.

bufferSize int

Size of the Buffer in bytes.

usage GraphicsResourceUsage

The usage for the Buffer, which determines who can read/write data. By default, it is Default.

Returns

Buffer

A new instance of Buffer.

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

device GraphicsDevice

The GraphicsDevice.

data ReadOnlySpan<byte>

The data to initialize the Index Buffer.

usage GraphicsResourceUsage

The usage for the Buffer, which determines who can read/write data. By default, it is Immutable.

Returns

Buffer

A new instance of Buffer.

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

device GraphicsDevice

The GraphicsDevice.

usage GraphicsResourceUsage

The usage for the Buffer, which determines who can read/write data. By default, it is Default.

Returns

Buffer<T>

A new instance of Buffer.

Type Parameters

T

Type of the indices stored in the Buffer. It can only be short or int.

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

device GraphicsDevice

The GraphicsDevice.

value T

The value to initialize the Index Buffer.

usage GraphicsResourceUsage

The usage for the Buffer, which determines who can read/write data. By default, it is Immutable.

Returns

Buffer<T>

A new instance of Buffer.

Type Parameters

T

Type of the indices stored in the Buffer. It can only be short or int.

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

device GraphicsDevice

The GraphicsDevice.

data T[]

The data to initialize the Index Buffer.

usage GraphicsResourceUsage

The usage for the Buffer, which determines who can read/write data. By default, it is Immutable.

Returns

Buffer<T>

A new instance of Buffer.

Type Parameters

T

Type of the indices stored in the Buffer. It can only be short or int.

See Also