From 5ed1b03a91f2a43f8f39bb7eb89608f7cf17c22c Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 28 May 2009 13:03:19 +0100 Subject: [PATCH] [cogl] Make cogl_setup_viewport() a private function The setup_viewport() function should only be used by Clutter and not by application code. It can be emulated by changing the Stage size and perspective and requeueing a redraw after calling clutter_stage_ensure_viewport(). --- cogl.h.in | 10 ++++++---- common/cogl.c | 16 ++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cogl.h.in b/cogl.h.in index 188af09cd..a671aa00d 100644 --- a/cogl.h.in +++ b/cogl.h.in @@ -193,8 +193,8 @@ void cogl_ortho (float left, float near, float far); -/** - * cogl_setup_viewport: +/* + * _cogl_setup_viewport: * @width: Width of the viewport * @height: Height of the viewport * @fovy: Field of view angle in degrees @@ -208,9 +208,11 @@ void cogl_ortho (float left, * with one that has a viewing angle of @fovy along the y-axis and a * view scaled according to @aspect along the x-axis. The view is * clipped according to @z_near and @z_far on the z-axis. + * + * This function is used only by Clutter. */ -void cogl_setup_viewport (guint width, - guint height, +void _cogl_setup_viewport (guint width, + guint height, float fovy, float aspect, float z_near, diff --git a/common/cogl.c b/common/cogl.c index adeb479d2..336303917 100644 --- a/common/cogl.c +++ b/common/cogl.c @@ -475,12 +475,12 @@ cogl_viewport (guint width, } void -cogl_setup_viewport (guint width, - guint height, - float fovy, - float aspect, - float z_near, - float z_far) +_cogl_setup_viewport (guint width, + guint height, + float fovy, + float aspect, + float z_near, + float z_far) { float z_camera; CoglMatrix projection_matrix; @@ -488,7 +488,7 @@ cogl_setup_viewport (guint width, GE( glViewport (0, 0, width, height) ); /* For Ortho projection. - * _cogl_current_matrix_ortho (0, width << 16, 0, height << 16, -1 << 16, 1 << 16); + * _cogl_current_matrix_ortho (0, width, 0, height, -1, 1); */ cogl_perspective (fovy, aspect, z_near, z_far); @@ -542,7 +542,7 @@ cogl_setup_viewport (guint width, } CoglFeatureFlags -cogl_get_features () +cogl_get_features (void) { _COGL_GET_CONTEXT (ctx, 0);