void AddRawIndex( int i )

book_4_sparkGenerated
code_blocksInput

Description

The AddRawIndex method is used to add a raw index to the VertexBuffer. This method directly appends the given integer index to the internal index buffer without any additional processing or validation. It is typically used when you need to manually manage the indices of the vertex buffer, allowing for more control over the rendering process.

Usage

To use the AddRawIndex method, you must have an instance of the VertexBuffer class. Call the method with an integer parameter representing the index you wish to add. Ensure that the index is valid within the context of your vertex data.

Example

// Create a new VertexBuffer instance
VertexBuffer vertexBuffer = new VertexBuffer();

// Initialize the vertex buffer with index buffer usage
vertexBuffer.Init(true);

// Add a raw index to the vertex buffer
int index = 5;
vertexBuffer.AddRawIndex(index);

// Check if the vertex buffer is indexed
bool isIndexed = vertexBuffer.Indexed;
// Output: true if the buffer was initialized with index buffer usage