[cogl] deprecate cogl_viewport() in favour of cogl_set_viewport()

cogl_viewport only accepted a viewport width and height, but there are times
when it's also desireable to have a viewport offset so that a scene can be
translated after projection but before hitting the framebuffer.
This commit is contained in:
Robert Bragg 2009-11-03 13:26:58 +00:00
parent c2a982cf9c
commit 78ee3f71b2
2 changed files with 27 additions and 7 deletions

View File

@ -538,7 +538,7 @@ _cogl_disable_clip_planes (void)
} }
void void
_cogl_set_viewport (int x, cogl_set_viewport (int x,
int y, int y,
int width, int width,
int height) int height)
@ -562,7 +562,7 @@ void
cogl_viewport (guint width, cogl_viewport (guint width,
guint height) guint height)
{ {
_cogl_set_viewport (0, 0, width, height); cogl_set_viewport (0, 0, width, height);
} }
void void
@ -579,7 +579,7 @@ _cogl_setup_viewport (guint width,
_COGL_GET_CONTEXT (ctx, NO_RETVAL); _COGL_GET_CONTEXT (ctx, NO_RETVAL);
cogl_viewport (width, height); cogl_set_viewport (0, 0, width, height);
/* For Ortho projection. /* For Ortho projection.
* _cogl_matrix_stack_ortho (projection_stack, 0, width, 0, height, -1, 1); * _cogl_matrix_stack_ortho (projection_stack, 0, width, 0, height, -1, 1);

View File

@ -219,6 +219,8 @@ void _cogl_setup_viewport (guint width,
float z_near, float z_near,
float z_far); float z_far);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_viewport: * cogl_viewport:
* @width: Width of the viewport * @width: Width of the viewport
@ -229,7 +231,25 @@ void _cogl_setup_viewport (guint width,
* Since: 0.8.2 * Since: 0.8.2
*/ */
void cogl_viewport (guint width, void cogl_viewport (guint width,
guint height); guint height) G_GNUC_DEPRECATED;
#endif
/**
* cogl_set_viewport:
* @x: viewport X offset
* @x: viewport Y offset
* @width: Width of the viewport
* @height: Height of the viewport
*
* Replace the current viewport with the given values.
*
* Since: 1.2
*/
void cogl_set_viewport (int x,
int y,
int width,
int height);
/** /**
* cogl_push_matrix: * cogl_push_matrix: