39
39
COGL_BUFFER_DEFINE (AttributeBuffer, attribute_buffer);
41
41
CoglAttributeBuffer *
42
cogl_attribute_buffer_new (CoglContext *context,
42
cogl_attribute_buffer_new_with_size (CoglContext *context,
46
CoglAttributeBuffer *array = g_slice_new (CoglAttributeBuffer);
49
if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
45
CoglAttributeBuffer *buffer = g_slice_new (CoglAttributeBuffer);
54
47
/* parent's constructor */
55
_cogl_buffer_initialize (COGL_BUFFER (array),
48
_cogl_buffer_initialize (COGL_BUFFER (buffer),
59
51
COGL_BUFFER_BIND_TARGET_ATTRIBUTE_BUFFER,
60
52
COGL_BUFFER_USAGE_HINT_ATTRIBUTE_BUFFER,
61
53
COGL_BUFFER_UPDATE_HINT_STATIC);
63
_cogl_attribute_buffer_object_new (array);
55
return _cogl_attribute_buffer_object_new (buffer);
59
cogl_attribute_buffer_new (CoglContext *context,
63
CoglAttributeBuffer *buffer;
65
buffer = cogl_attribute_buffer_new_with_size (context, bytes);
67
/* Note: to keep the common cases simple this API doesn't throw
68
* CoglErrors, so developers can assume this function never returns
69
* NULL and we will simply abort on error.
71
* Developers wanting to catch errors can use
72
* cogl_attribute_buffer_new_with_size() and catch errors when later
73
* calling cogl_buffer_set_data() or cogl_buffer_map().
76
/* XXX: NB: for Cogl 2.0 we don't allow NULL data here but we can't
77
* break the api for 1.x and so we keep the check for now. */
66
cogl_buffer_set_data (COGL_BUFFER (array),
79
_cogl_buffer_set_data (COGL_BUFFER (buffer),