diff options
author | Robert Bragg <robert@linux.intel.com> | 2011-08-01 20:50:47 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-08-02 12:05:37 +0100 |
commit | 89fd2edeb088570c4fcecbbffa404b65b3dad868 (patch) | |
tree | 9dcbd95b1b181567a03d281dcfdf5f15724b2751 /cogl/cogl.c | |
parent | ee01fd263a94a36467bc320f8436681b48945439 (diff) | |
download | cogl-89fd2edeb088570c4fcecbbffa404b65b3dad868.tar.gz |
Flush the journal before changing the projection
Since the projection matrix isn't tracked in the journal and since our
software transform of vertices as we log into the journal doesn't
include the projective transform we need to make sure we flush all
primitives in the journal before ever changing the projection.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'cogl/cogl.c')
-rw-r--r-- | cogl/cogl.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cogl/cogl.c b/cogl/cogl.c index e3eb3c31..e9621c2f 100644 --- a/cogl/cogl.c +++ b/cogl/cogl.c @@ -826,6 +826,10 @@ cogl_frustum (float left, _COGL_GET_CONTEXT (ctx, NO_RETVAL); + /* XXX: The projection matrix isn't currently tracked in the journal + * so we need to flush all journaled primitives first... */ + cogl_flush (); + _cogl_matrix_stack_load_identity (projection_stack); _cogl_matrix_stack_frustum (projection_stack, @@ -851,6 +855,10 @@ cogl_ortho (float left, _COGL_GET_CONTEXT (ctx, NO_RETVAL); + /* XXX: The projection matrix isn't currently tracked in the journal + * so we need to flush all journaled primitives first... */ + cogl_flush (); + cogl_matrix_init_identity (&ortho); cogl_matrix_ortho (&ortho, left, right, bottom, top, z_near, z_far); _cogl_matrix_stack_set (projection_stack, &ortho); @@ -888,10 +896,13 @@ cogl_set_projection_matrix (CoglMatrix *matrix) { CoglMatrixStack *projection_stack = _cogl_framebuffer_get_projection_stack (cogl_get_draw_framebuffer ()); + + /* XXX: The projection matrix isn't currently tracked in the journal + * so we need to flush all journaled primitives first... */ + cogl_flush (); + _cogl_matrix_stack_set (projection_stack, matrix); - /* FIXME: Update the inverse projection matrix!! Presumably use - * of clip planes must currently be broken if this API is used. */ _COGL_MATRIX_DEBUG_PRINT (matrix); } |