Use GL_QUADS for flushing a quad batch
Instead of using GL_TRIANGLES and uploading the indices every time, it now uses GL_QUADS instead on OpenGL. Under GLES it still uses indices but it uses the new cogl_vertex_buffer_indices_get_for_quads function to avoid uploading the vertices every time. This requires the _cogl_vertex_buffer_indices_pointer_from_handle function to be exposed privately to the rest of Cogl. The static_indices array has been removed from the Cogl context.
This commit is contained in:
@@ -72,7 +72,6 @@ cogl_create_context ()
|
||||
|
||||
_context->journal = g_array_new (FALSE, FALSE, sizeof (CoglJournalEntry));
|
||||
_context->logged_vertices = g_array_new (FALSE, FALSE, sizeof (GLfloat));
|
||||
_context->static_indices = g_array_new (FALSE, FALSE, sizeof (GLushort));
|
||||
_context->polygon_vertices = g_array_new (FALSE, FALSE,
|
||||
sizeof (CoglTextureGLVertex));
|
||||
|
||||
@@ -162,8 +161,6 @@ _cogl_destroy_context ()
|
||||
if (_context->logged_vertices)
|
||||
g_array_free (_context->logged_vertices, TRUE);
|
||||
|
||||
if (_context->static_indices)
|
||||
g_array_free (_context->static_indices, TRUE);
|
||||
if (_context->polygon_vertices)
|
||||
g_array_free (_context->polygon_vertices, TRUE);
|
||||
if (_context->current_layers)
|
||||
|
@@ -80,7 +80,6 @@ typedef struct
|
||||
* can batch things together. */
|
||||
GArray *journal;
|
||||
GArray *logged_vertices;
|
||||
GArray *static_indices;
|
||||
GArray *polygon_vertices;
|
||||
|
||||
/* Some simple caching, to minimize state changes... */
|
||||
|
Reference in New Issue
Block a user