### Constructor

# Cogl Attribute new_const_2x2fv

#### Declaration [src]

    CoglAttribute*
    cogl_attribute_new_const_2x2fv (
      CoglContext* context,
      const char* name,
      const float* matrix2x2,
      gboolean transpose
    )

#### Description [src]

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

`matrix2x2` represent a square 2 by 2 matrix specified in column-major order (each pair of consecutive numbers represents a column) which should have a corresponding declaration in GLSL code like:

[| attribute mat2 name; |]

If `transpose` is `TRUE` then all matrix components are rotated around the diagonal of the matrix such that the first column becomes the first row and the second column becomes the second row.

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

`matrix2x2`

  Type: `const float*`

  A pointer to a 2 by 2 matrix.

  The data is owned by the caller of the function.

`transpose`

  Type: `gboolean`

  Whether the matrix should be transposed on upload or not.

#### Return value

Type: `CoglAttribute`

A newly allocated `CoglAttribute` representing the given constant matrix.

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