cogl/matrix: Add cogl_matrix_init_from_matrix initializer
It does a simple memcpy() to clone the entire structure. This will be necessary for a smoother removal of ClutterMatrix. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
This commit is contained in:
parent
c2dbdb3703
commit
a761caf079
@ -1700,6 +1700,13 @@ cogl_matrix_init_from_array (CoglMatrix *matrix, const float *array)
|
|||||||
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cogl_matrix_init_from_matrix (CoglMatrix *matrix,
|
||||||
|
const CoglMatrix *source)
|
||||||
|
{
|
||||||
|
memcpy (matrix, source, sizeof (CoglMatrix));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_cogl_matrix_init_from_matrix_without_inverse (CoglMatrix *matrix,
|
_cogl_matrix_init_from_matrix_without_inverse (CoglMatrix *matrix,
|
||||||
const CoglMatrix *src)
|
const CoglMatrix *src)
|
||||||
|
@ -463,6 +463,17 @@ COGL_EXPORT void
|
|||||||
cogl_matrix_init_from_array (CoglMatrix *matrix,
|
cogl_matrix_init_from_array (CoglMatrix *matrix,
|
||||||
const float *array);
|
const float *array);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cogl_matrix_init_from_matrix:
|
||||||
|
* @matrix: A 4x4 transformation matrix
|
||||||
|
* @source: the #CoglMatrix to copy
|
||||||
|
*
|
||||||
|
* Initializes @matrix with the contents of @source
|
||||||
|
*/
|
||||||
|
COGL_EXPORT void
|
||||||
|
cogl_matrix_init_from_matrix (CoglMatrix *matrix,
|
||||||
|
const CoglMatrix *source);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_get_array:
|
* cogl_matrix_get_array:
|
||||||
* @matrix: A 4x4 transformation matrix
|
* @matrix: A 4x4 transformation matrix
|
||||||
|
Loading…
Reference in New Issue
Block a user