### Constructor

# Cogl Attribute new_const_3f

#### Declaration [src]

    CoglAttribute*
    cogl_attribute_new_const_3f (
      CoglContext* context,
      const char* name,
      float component0,
      float component1,
      float component2
    )

#### Description [src]

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

The constants (`component0`, `component1`, `component2`) represent a 3 component float vector which should have a corresponding declaration in GLSL code like:

[| attribute vec3 name; |]

unless the built in name “cogl_normal_in” 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.

`component0`

  Type: `float`

  The first component of a 3 component vector.

`component1`

  Type: `float`

  The second component of a 3 component vector.

`component2`

  Type: `float`

  The third component of a 3 component vector.

#### 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.