Constructor

CoglAttributenew_const_4fv

Declaration [src]

CoglAttribute*
cogl_attribute_new_const_4fv (
  CoglContext* context,
  const char* name,
  const float* value
)

Description [src]

Creates a new, 4 component, attribute whose value remains constant across all the vertices of a primitive without needing to duplicate the value for each vertex.

The constants (value[0], value[1], value[2], value[3]) represent a 4 component float vector which should have a corresponding declaration in GLSL code like:

[| attribute vec4 name; |]

unless one of the built in names “cogl_color_in”, “cogl_tex_coord0_in or “cogl_tex_coord1_in” etc is being used where no explicit GLSL declaration need be made.

Parameters

context

Type: CoglContext

A CoglContext.

The data is owned by the caller of the function.
name

Type: const char*

The name of the attribute (used to reference it from GLSL)

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
value

Type: const float*

A pointer to a 4 component float vector.

The data is owned by the caller of the function.

Return value

Type: CoglAttribute

A newly allocated CoglAttribute representing the given constant vector.

The caller of the function takes ownership of the data, and is responsible for freeing it.