From 3f28168f1e119fec90146e97a2db0ac6feebc107 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 1 Dec 2011 12:33:30 +0000 Subject: [PATCH] attribute: Add the buffer and normalized property APIs to the header The header was missing declarations for cogl_attribute_{get,set}_{buffer,normalized}. Reviewed-by: Robert Bragg --- cogl/cogl-attribute.h | 62 +++++++++++++++++++ .../cogl-2.0-experimental-sections.txt | 4 ++ 2 files changed, 66 insertions(+) diff --git a/cogl/cogl-attribute.h b/cogl/cogl-attribute.h index 755950e0e..c12990b98 100644 --- a/cogl/cogl-attribute.h +++ b/cogl/cogl-attribute.h @@ -139,6 +139,68 @@ cogl_attribute_new (CoglAttributeBuffer *attribute_buffer, int components, CoglAttributeType type); +/** + * cogl_attribute_set_normalized: + * @attribute: A #CoglAttribute + * @normalized: The new value for the normalized property. + * + * Sets whether fixed point attribute types are mapped to the range + * 0→1. For example when this property is TRUE and a + * %COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE type is used then the value 255 + * will be mapped to 1.0. + * + * The default value of this property depends on the name of the + * attribute. For the builtin properties cogl_color_in and + * cogl_normal_in it will default to TRUE and for all other names it + * will default to FALSE. + * + * Stability: unstable + * Since: 1.10 + */ +void +cogl_attribute_set_normalized (CoglAttribute *attribute, + gboolean normalized); + +/** + * cogl_attribute_get_normalized: + * @attribute: A #CoglAttribute + * + * Return value: the value of the normalized property set with + * cogl_attribute_set_normalized(). + * + * Stability: unstable + * Since: 1.10 + */ +gboolean +cogl_attribute_get_normalized (CoglAttribute *attribute); + +/** + * cogl_attribute_get_buffer: + * @attribute: A #CoglAttribute + * + * Return value: the #CoglAttributeBuffer that was set with + * cogl_attribute_set_buffer() or cogl_attribute_new(). + * + * Stability: unstable + * Since: 1.10 + */ +CoglAttributeBuffer * +cogl_attribute_get_buffer (CoglAttribute *attribute); + +/** + * cogl_attribute_set_buffer: + * @attribute: A #CoglAttribute + * @attribute_buffer: A #CoglAttributeBuffer + * + * Sets a new #CoglAttributeBuffer for the attribute. + * + * Stability: unstable + * Since: 1.10 + */ +void +cogl_attribute_set_buffer (CoglAttribute *attribute, + CoglAttributeBuffer *attribute_buffer); + /** * cogl_is_attribute: * @object: A #CoglObject diff --git a/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt b/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt index 842126387..0a9a65562 100644 --- a/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt +++ b/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt @@ -189,6 +189,10 @@ cogl_is_index_array Vertex Attributes cogl_attribute_new cogl_is_attribute +cogl_attribute_set_normalized +cogl_attribute_get_normalized +cogl_attribute_get_buffer +cogl_attribute_set_buffer