matrix: Add cogl_matrix_orthographic

This adds an experimental cogl_matrix_orthographic() function that is
more consistent with other Cogl api by taking x_1, y_1, x_2, y_2
arguments to define the top-left and bottom-right coordinates of the
orthographic coordinates instead of OpenGL style left, right, bottom and
top values.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Robert Bragg
2011-11-18 14:07:17 +00:00
parent ba02f70961
commit a4f3d0d18b
3 changed files with 63 additions and 18 deletions

View File

@ -294,6 +294,36 @@ cogl_matrix_perspective (CoglMatrix *matrix,
float z_near,
float z_far);
#ifdef COGL_ENABLE_EXPERIMENTAL_API
#define cogl_matrix_orthographic cogl_matrix_orthographic_EXP
/**
* cogl_matrix_orthographic:
* @matrix: A 4x4 transformation matrix
* @x_1: The x coordinate for the first vertical clipping plane
* @y_1: The y coordinate for the first horizontal clipping plane
* @x_2: The x coordinate for the second vertical clipping plane
* @y_2: The y coordinate for the second horizontal clipping plane
* @near: The <emphasis>distance</emphasis> to the near clipping
* plane (will be <emphasis>negative</emphasis> if the plane is
* behind the viewer)
* @far: The <emphasis>distance</emphasis> to the far clipping
* plane (will be <emphasis>negative</emphasis> if the plane is
* behind the viewer)
*
* Multiplies @matrix by a parallel projection matrix.
*
* Since: 1.10
*/
void
cogl_matrix_orthographic (CoglMatrix *matrix,
float x_1,
float y_1,
float x_2,
float y_2,
float near,
float far);
#endif
/**
* cogl_matrix_ortho:
* @matrix: A 4x4 transformation matrix
@ -307,6 +337,8 @@ cogl_matrix_perspective (CoglMatrix *matrix,
* the plane is behind the viewer)
*
* Multiplies @matrix by a parallel projection matrix.
*
* Deprecated: 1.10: Use cogl_matrix_orthographic()
*/
void
cogl_matrix_ortho (CoglMatrix *matrix,