Constructor

CoglAttributenew_const_4x4fv

Declaration [src]

CoglAttribute*
cogl_attribute_new_const_4x4fv (
  CoglContext* context,
  const char* name,
  const float* matrix4x4,
  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.

matrix4x4 represent a square 4 by 4 matrix specified in column-major order (each 4-tuple of consecutive numbers represents a column) which should have a corresponding declaration in GLSL code like:

[| attribute mat4 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 etc.

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

Type: const float*

A pointer to a 4 by 4 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.