mirror of
https://github.com/brl/mutter.git
synced 2025-04-13 13:49:38 +00:00
cogl/matrix: Add cogl_matrix_get_value
This will allow us stop accessing members of the structure directly. Also mark all struct members as private. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
This commit is contained in:
parent
e06139323b
commit
8e125fbab6
@ -1941,6 +1941,14 @@ cogl_matrix_get_array (const CoglMatrix *matrix)
|
|||||||
return (float *)matrix;
|
return (float *)matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
cogl_matrix_get_value (const CoglMatrix *matrix,
|
||||||
|
unsigned int row,
|
||||||
|
unsigned int column)
|
||||||
|
{
|
||||||
|
return MAT ((float *)matrix, row, column);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_transform_point (const CoglMatrix *matrix,
|
cogl_matrix_transform_point (const CoglMatrix *matrix,
|
||||||
float *x,
|
float *x,
|
||||||
|
@ -86,6 +86,8 @@ G_BEGIN_DECLS
|
|||||||
*/
|
*/
|
||||||
struct _CoglMatrix
|
struct _CoglMatrix
|
||||||
{
|
{
|
||||||
|
/*< private >*/
|
||||||
|
|
||||||
/* column 0 */
|
/* column 0 */
|
||||||
float xx;
|
float xx;
|
||||||
float yx;
|
float yx;
|
||||||
@ -110,8 +112,6 @@ struct _CoglMatrix
|
|||||||
float zw;
|
float zw;
|
||||||
float ww;
|
float ww;
|
||||||
|
|
||||||
/*< private >*/
|
|
||||||
|
|
||||||
/* Note: we may want to extend this later with private flags
|
/* Note: we may want to extend this later with private flags
|
||||||
* and a cache of the inverse transform matrix. */
|
* and a cache of the inverse transform matrix. */
|
||||||
float COGL_PRIVATE (inv)[16];
|
float COGL_PRIVATE (inv)[16];
|
||||||
@ -491,6 +491,17 @@ cogl_matrix_init_from_matrix (CoglMatrix *matrix,
|
|||||||
COGL_EXPORT const float *
|
COGL_EXPORT const float *
|
||||||
cogl_matrix_get_array (const CoglMatrix *matrix);
|
cogl_matrix_get_array (const CoglMatrix *matrix);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cogl_matrix_get_value:
|
||||||
|
* @matrix: A 4x4 transformation matrix
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
COGL_EXPORT float
|
||||||
|
cogl_matrix_get_value (const CoglMatrix *matrix,
|
||||||
|
unsigned int row,
|
||||||
|
unsigned int column);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_init_from_euler:
|
* cogl_matrix_init_from_euler:
|
||||||
* @matrix: A 4x4 transformation matrix
|
* @matrix: A 4x4 transformation matrix
|
||||||
|
Loading…
x
Reference in New Issue
Block a user