## CoglAttributeBuffer: Buffers of vertex attributes

CoglAttributeBuffer: Buffers of vertex attributes — Functions for creating and manipulating attribute buffers

## Functions

CoglAttributeBuffer * | cogl_attribute_buffer_new_with_size ()
CoglAttributeBuffer * | cogl_attribute_buffer_new ()
CoglBool | cogl_is_attribute_buffer ()

## Types and Values

| CoglAttributeBuffer

## Description

FIXME

## Functions

### cogl_attribute_buffer_new_with_size ()

    CoglAttributeBuffer *
    cogl_attribute_buffer_new_with_size (CoglContext *context,
                                         size_t bytes);

Describes a new CoglAttributeBuffer of `size` bytes to contain arrays of vertex attribute data. Afterwards data can be set using `cogl_buffer_set_data()` or by mapping it into the application's address space using `cogl_buffer_map()`.

The underlying storage of this buffer isn't allocated by this function so that you have an opportunity to use the `cogl_buffer_set_update_hint()` and `cogl_buffer_set_usage_hint()` functions which may influence how the storage is allocated. The storage will be allocated once you upload data to the buffer.

Note: You can assume this function always succeeds and won't return `NULL`

#### Parameters

context | A CoglContext |
bytes | The number of bytes to allocate for vertex attribute data. |

#### Returns

A newly allocated CoglAttributeBuffer. Never `NULL`.

[transfer full]

Stability Level: Unstable

### cogl_attribute_buffer_new ()

    CoglAttributeBuffer *
    cogl_attribute_buffer_new (CoglContext *context,
                               size_t bytes,
                               const void *data);

Describes a new CoglAttributeBuffer of `size` bytes to contain arrays of vertex attribute data and also uploads `size` bytes read from `data` to the new buffer.

You should never pass a `NULL` data pointer.

This function does not report out-of-memory errors back to the caller by returning `NULL` and so you can assume this function always succeeds.
In the unlikely case that there is an out of memory problem then Cogl will abort the application with a message. If your application needs to gracefully handle out-of-memory errors then you can use `cogl_attribute_buffer_new_with_size()` and then explicitly catch errors with `cogl_buffer_set_data()` or `cogl_buffer_map()`.

#### Parameters

context | A CoglContext |
bytes | The number of bytes to allocate for vertex attribute data. |
data | An optional pointer to vertex data to upload immediately. | [array length=bytes]

#### Returns

A newly allocated CoglAttributeBuffer (never `NULL`).

[transfer full]

Since: 1.4

Stability Level: Unstable

### cogl_is_attribute_buffer ()

    CoglBool
    cogl_is_attribute_buffer (void *object);

Gets whether the given object references a CoglAttributeBuffer.

#### Parameters

object | A CoglObject |

#### Returns

`TRUE` if `object` references a CoglAttributeBuffer, `FALSE` otherwise

Since: 1.4

Stability Level: Unstable

## Types and Values

### CoglAttributeBuffer

    typedef struct _CoglAttributeBuffer CoglAttributeBuffer;