### Method

# Cogl Primitive set_indices

#### Declaration [src]

    void
    cogl_primitive_set_indices (
      CoglPrimitive* primitive,
      CoglIndices* indices,
      int n_indices
    )

#### Description [src]

Associates a sequence of `CoglIndices` with the given `primitive`.

`CoglIndices` 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 `CoglPrimitive` `n_vertices` property as if `cogl_primitive_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.

The `CoglPrimitive` `first_vertex` property also affects drawing with indices by defining the first entry of the indices to start drawing from.

#### Parameters

`indices`

  Type: An array of `CoglIndices`

  A `CoglIndices` array.

  The length of the array is specified in the `n_indices` argument.
  The data is owned by the caller of the method.

`n_indices`

  Type: `int`

  The number of indices to reference when drawing.