diff options
author | Robert Bragg <robert@linux.intel.com> | 2009-05-28 12:49:29 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2009-05-28 13:27:54 +0100 |
commit | 2367e7d27140df826829177b236534ee1a01be15 (patch) | |
tree | dbbf76866d902c4de9722ec9d28f7c704d68b27d /cogl-vertex-buffer.h | |
parent | 43623a6c44a9c4778cd72fefde3e76d24762cbdb (diff) | |
download | cogl-2367e7d27140df826829177b236534ee1a01be15.tar.gz |
[cogl vertex buffers] Give indices a CoglHandle so they are shareable
Previously indices were tightly bound to a particular Cogl vertex buffer
but we would like to be able to share indices so now we have
cogl_vertex_buffer_indices_new () which returns a CoglHandle.
In particular we could like to have a shared set of indices for drawing
lists of quads that can be shared between the pango renderer and the
Cogl journal.
Diffstat (limited to 'cogl-vertex-buffer.h')
-rw-r--r-- | cogl-vertex-buffer.h | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/cogl-vertex-buffer.h b/cogl-vertex-buffer.h index 1887db56..ba2cef8b 100644 --- a/cogl-vertex-buffer.h +++ b/cogl-vertex-buffer.h @@ -303,10 +303,7 @@ typedef enum _CoglIndicesType } CoglIndicesType; /** - * cogl_vertex_buffer_add_indices: - * @handle: A vertex buffer handle - * @min_index: Specifies the minimum vertex index contained in indices - * @max_index: Specifies the maximum vertex index contained in indices + * cogl_vertex_buffer_indices_new: * @indices_type: a #CoglIndicesType specifying the data type used for * the indices. * @indices_array: Specifies the address of your array of indices @@ -317,19 +314,11 @@ typedef enum _CoglIndicesType * array allows you to reference vertices multiple times, for example * during triangle strips. * - * You should aim to use the smallest data type possible and correctly reflect - * the range of index values in the {min,max}_index arguments. This allows Cogl - * to optimize the internal storage used for the indices and reduce the demand - * for memory bandwidth. - * - * Returns: An identifier (greater than 0) for the indices which you can - * pass to cogl_vertex_buffer_draw_elements(). + * Returns: A CoglHandle for the indices which you can pass to + * cogl_vertex_buffer_draw_elements(). */ -int -cogl_vertex_buffer_add_indices (CoglHandle handle, - int min_index, - int max_index, - CoglIndicesType indices_type, +CoglHandle +cogl_vertex_buffer_indices_new (CoglIndicesType indices_type, const void *indices_array, int indices_len); @@ -352,16 +341,17 @@ cogl_vertex_buffer_delete_indices (CoglHandle handle, * @handle: A vertex buffer handle * @mode: A #CoglVerticesMode specifying how the vertices should be * interpreted. - * @indices_id: The identifier for a an array of indices previously added to - * the given Cogl vertex buffer using - * cogl_vertex_buffer_add_indices(). + * @indices: A CoglHandle for a set of indices allocated via + * cogl_vertex_buffer_indices_new () + * @min_index: Specifies the minimum vertex index contained in indices + * @max_index: Specifies the maximum vertex index contained in indices * @indices_offset: An offset into named indices. The offset marks the first * index to use for drawing. * @count: Specifies the number of vertices you want to draw. * * This function lets you use an array of indices to specify the vertices * within your vertex buffer that you want to draw. The indices themselves - * are given by calling cogl_vertex_buffer_add_indices () + * are created by calling cogl_vertex_buffer_indices_new () * * Any un-submitted attribute changes are automatically submitted before * drawing. @@ -369,7 +359,9 @@ cogl_vertex_buffer_delete_indices (CoglHandle handle, void cogl_vertex_buffer_draw_elements (CoglHandle handle, CoglVerticesMode mode, - int indices_id, + CoglHandle indices, + int min_index, + int max_index, int indices_offset, int count); |