Groups a collection of attributes, optionally an indices array, a draw mode, a vertex/index offset and defines the number of vertices so it wraps up enough information to be retained (e.g. in a renderlist or journal) and drawn later.
cogl_vertices_new (mode, n_vertices, attribute, attribute, NULL); cogl_vertices_new_with_indices (vertices, mode, n_vertices, indices, attribute, attribute, NULL); cogl_vertices_set_attributes (vertices, attribute, attribute, NULL);
typedef struct
{
float x, y, z;
float s, t;
guint8 r, g, b, a;
} CoglV3T2C4;
cogl_vertices_new_with_v3t2c4_attributes (mode, n_vertices, data);
cogl_vertices_set_data (vertices, 0, sizeof (my_vertices), my_vertices);
cogl_vertices_set_indices (vertices, indices, min_index, max_index); cogl_vertices_set_draw_range (vertices, first_vertex, n_vertices);
cogl_vertices_set_indexed_draw_range (vertices, first_vertex, n_vertices, min_index, max_index);
cogl_vertices_draw (vertices);
Do we need more ways to query and manipulate the attributes like:
cogl_vertices_foreach_attribute (vertices, attribute_callback, user_data); cogl_vertices_find_attribute (vertices, name); cogl_vertices_remove_attribute (vertices, attribute); cogl_vertices_add_attribute (vertices, attribute);
CoglV2C4Vertex vertices[] =
{
.....
};
CoglVertices *vertices =
cogl_vertices_new_with_v2c4_attributes (COGL_DRAW_MODE_TRIANGLES, G_N_ELEMENTS (vertices), vertices);
cogl_vertices_draw ();