Cogl.Primitive.prototype.set_indices
function set_indices(indices: Cogl.Indices, n_indices: Number(gint)): void {
// Gjs wrapper for cogl_primitive_set_indices()
}
Associates a sequence of Cogl.Indices with the given primitive.
Cogl.Indices provide a way to virtualize your real vertex data by providing a sequence of indices that index into your real vertex data. The GPU will walk though the index values to indirectly lookup the data for each vertex instead of sequentially walking through the data directly. This lets you save memory by indexing shared data multiple times instead of duplicating the data.
The value passed as n_indices will simply update the Cogl.Primitive <structfield>n_vertices</structfield> property as if Cogl.Primitive.prototype.set_n_vertices were called. This property defines the number of vertices to draw or, put another way, how many indices should be read from indices when drawing.
<note>The Cogl.Primitive <structfield>first_vertex</structfield> property also affects drawing with indices by defining the first entry of the indices to start drawing from.</note>
Since 1.10
- indices
A Cogl.Indices array
- n_indices
The number of indices to reference when drawing