Don't pass around NULL terminated CoglAttribute arrays

For the first iteration of the CoglAttribute API several of the new
functions accepted a pointer to a NULL terminated list of CoglAttribute
pointers - probably as a way to reduce the number of arguments required.
This style isn't consistent with existing Cogl APIs though and so we now
explicitly pass n_attributes arguments and don't require the NULL
termination.
This commit is contained in:
Robert Bragg
2011-03-03 01:02:12 +00:00
parent bf7653ac93
commit 3c1e83c7f5
9 changed files with 223 additions and 201 deletions

View File

@ -1165,7 +1165,7 @@ update_primitive_attributes (CoglVertexBuffer *buffer)
g_return_if_fail (n_attributes > 0);
attributes = g_alloca (sizeof (CoglAttribute *) * (n_attributes + 1));
attributes = g_alloca (sizeof (CoglAttribute *) * n_attributes);
i = 0;
for (l = buffer->submitted_vbos; l; l = l->next)
@ -1195,9 +1195,7 @@ update_primitive_attributes (CoglVertexBuffer *buffer)
}
}
attributes[i] = NULL;
cogl_primitive_set_attributes (buffer->primitive, attributes);
cogl_primitive_set_attributes (buffer->primitive, attributes, i);
}
static void