matrix: Add cogl_debug_matrix_print api

As a convenience for debugging this adds a cogl_debug_matrix_print
function that prints out the components of a matrix and any internal
flags associated with the given matrix.

(cherry picked from commit 3b33889ff1204f19347a9548320ba95baa54c18c)
This commit is contained in:
Robert Bragg 2012-06-20 15:50:18 +01:00
parent 0ffad6ba20
commit 1161870670
3 changed files with 13 additions and 5 deletions

View File

@ -35,12 +35,9 @@ G_BEGIN_DECLS
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_MATRICES))) \
{ \
g_print ("%s:\n", G_STRFUNC); \
_cogl_matrix_print (MATRIX); \
cogl_debug_matrix_print (MATRIX); \
}
void
_cogl_matrix_print (const CoglMatrix *matrix);
void
_cogl_matrix_prefix_print (const char *prefix, const CoglMatrix *matrix);

View File

@ -398,7 +398,7 @@ _cogl_matrix_prefix_print (const char *prefix, const CoglMatrix *matrix)
* Dumps the contents of a CoglMatrix structure.
*/
void
_cogl_matrix_print (const CoglMatrix *matrix)
cogl_debug_matrix_print (const CoglMatrix *matrix)
{
_cogl_matrix_prefix_print ("", matrix);
}

View File

@ -762,6 +762,17 @@ cogl_matrix_is_identity (const CoglMatrix *matrix);
void
cogl_matrix_transpose (CoglMatrix *matrix);
/**
* cogl_debug_matrix_print:
* @matrix: A #CoglMatrix
*
* Prints the contents of a #CoglMatrix to stdout.
*
* Since: 2.0
*/
void
cogl_debug_matrix_print (const CoglMatrix *matrix);
#ifdef _COGL_SUPPORTS_GTYPE_INTEGRATION
#define COGL_GTYPE_TYPE_MATRIX (cogl_gtype_matrix_get_type ())