CoglAttributeBuffer: Buffers of vertex attributes

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

Synopsis

                    CoglAttributeBuffer;
CoglAttributeBuffer * cogl_attribute_buffer_new_with_size
                                                        (CoglContext *context,
                                                         size_t bytes);
CoglAttributeBuffer * cogl_attribute_buffer_new         (CoglContext *context,
                                                         size_t bytes,
                                                         const void *data);
CoglBool            cogl_is_attribute_buffer            (void *object);

Description

FIXME

Details

CoglAttributeBuffer

typedef struct _CoglAttributeBuffer CoglAttributeBuffer;

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

context :

A CoglContext

bytes :

The number of bytes to allocate for vertex attribute data.

Returns :

A newly allocated CoglAttributeBuffer. Never NULL.

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.

Note

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.

Note

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().

context :

A CoglContext

bytes :

The number of bytes to allocate for vertex attribute data.

data :

An optional pointer to vertex data to upload immediately.

Returns :

A newly allocated CoglAttributeBuffer (never NULL)

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.

object :

A CoglObject

Returns :

TRUE if object references a CoglAttributeBuffer, FALSE otherwise

Since 1.4

Stability Level: Unstable