mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
cogl: adds convenience cogl_multiply_matrix function
Quite often it's desirable to be able to multiply the current modelview matrix by an arbitrary matrix. Currently though you have to first explicitly call cogl_get_modelview_matrix to get the current modelview into a temporary variable, then you need to multiply it with your matrix using cogl_matrix_multiply and finally use cogl_set_modelview_matrix to make the result be the new modelview. This new convenience function lets more efficiently skip the first get and last set steps.
This commit is contained in:
parent
1dd70aff73
commit
a678e9f627
@ -937,6 +937,14 @@ cogl_rotate (float angle, float x, float y, float z)
|
||||
_cogl_matrix_stack_rotate (modelview_stack, angle, x, y, z);
|
||||
}
|
||||
|
||||
void
|
||||
cogl_multiply_matrix (const CoglMatrix *matrix)
|
||||
{
|
||||
CoglMatrixStack *modelview_stack =
|
||||
_cogl_framebuffer_get_modelview_stack (_cogl_get_framebuffer ());
|
||||
_cogl_matrix_stack_multiply (modelview_stack, matrix);
|
||||
}
|
||||
|
||||
void
|
||||
cogl_perspective (float fov_y,
|
||||
float aspect,
|
||||
|
@ -347,6 +347,17 @@ cogl_rotate (float angle,
|
||||
float y,
|
||||
float z);
|
||||
|
||||
/**
|
||||
* cogl_multiply_matrix:
|
||||
* @matrix: the matrix to multiply with the current model-view
|
||||
*
|
||||
* Multiplies the current model-view matrix by the given matrix.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
cogl_multiply_matrix (const CoglMatrix *matrix);
|
||||
|
||||
/**
|
||||
* cogl_get_modelview_matrix:
|
||||
* @matrix: (out): return location for the model-view matrix
|
||||
|
Loading…
Reference in New Issue
Block a user