get_for_quads


Description:

public static unowned VertexBufferIndices get_for_quads (uint n_indices)

Creates a vertex buffer containing the indices needed to draw pairs of triangles from a list of vertices grouped as quads.

Note:

Use the CoglPrimitive api instead

There will be at least n_indices entries in the buffer (but there may be more).

The indices will follow this pattern:

0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7 ... etc

For example, if you submit vertices for a quad like like that shown in quad-indices-order then you can request 6 indices to render two triangles like those shown in quad-indices-triangles.

Example of vertices submitted to form a quad:

Illustration of the triangle indices that will be generated:

Parameters:

n_indices

the number of indices in the vertex buffer.

Returns:

A VertexBufferIndices containing the indices. The handled is owned by Cogl and should not be modified or unref'd.




2022 vala-language.org