matrix: Adds cogl_matrix_is_identity API
This adds a function called cogl_matrix_is_identity that can determine if a given matrix is an identity matrix or not. Signed-off-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
@ -2041,3 +2041,13 @@ cogl_matrix_project_points (const CoglMatrix *matrix,
|
||||
n_points);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
cogl_matrix_is_identity (const CoglMatrix *matrix)
|
||||
{
|
||||
if (!(matrix->flags & MAT_DIRTY_TYPE) &&
|
||||
matrix->type == COGL_MATRIX_TYPE_IDENTITY)
|
||||
return TRUE;
|
||||
else
|
||||
return memcmp (matrix, identity, sizeof (float) * 16) == 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user