summaryrefslogtreecommitdiff
path: root/cogl/cogl-attribute.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2011-02-02 14:23:53 +0000
committerNeil Roberts <neil@linux.intel.com>2011-02-15 12:10:54 +0000
commita067e7a16b52488b0bf66845959d649de4ca0d43 (patch)
treed72c423de08237cc3e9c01956ee831c047eadde5 /cogl/cogl-attribute.c
parent4d6754ed0fc9202602241aa0c656befce651033e (diff)
downloadcogl-a067e7a16b52488b0bf66845959d649de4ca0d43.tar.gz
cogl-framebuffer: Separate the draw and read buffer
The current framebuffer is now internally separated so that there can be a different draw and read buffer. This is required to use the GL_EXT_framebuffer_blit extension. The current draw and read buffers are stored as a pair in a single stack so that pushing the draw and read buffer is done simultaneously with the new _cogl_push_framebuffers internal function. Calling cogl_pop_framebuffer will restore both the draw and read buffer to the previous state. The public cogl_push_framebuffer function is layered on top of the new function so that it just pushes the same buffer for both drawing and reading. When flushing the framebuffer state, the cogl_framebuffer_flush_state function now tackes a pointer to both the draw and the read buffer. Anywhere that was just flushing the state for the current framebuffer with _cogl_get_framebuffer now needs to call both _cogl_get_draw_buffer and _cogl_get_read_buffer.
Diffstat (limited to 'cogl/cogl-attribute.c')
-rw-r--r--cogl/cogl-attribute.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cogl/cogl-attribute.c b/cogl/cogl-attribute.c
index 5cb89868..5872aa23 100644
--- a/cogl/cogl-attribute.c
+++ b/cogl/cogl-attribute.c
@@ -480,7 +480,7 @@ enable_gl_state (CoglDrawFlags flags,
CoglAttribute **attributes,
ValidateLayerState *state)
{
- CoglFramebuffer *framebuffer = _cogl_get_framebuffer ();
+ CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
int i;
#ifdef MAY_HAVE_PROGRAMABLE_GL
GLuint generic_index = 0;
@@ -1060,7 +1060,7 @@ flush_state (CoglDrawFlags flags,
{
if (!(flags & COGL_DRAW_SKIP_JOURNAL_FLUSH))
{
- CoglFramebuffer *framebuffer = _cogl_get_framebuffer ();
+ CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
_cogl_journal_flush (framebuffer->journal, framebuffer);
}
@@ -1080,7 +1080,9 @@ flush_state (CoglDrawFlags flags,
* stack can cause some drawing which would change the array
* pointers. */
if (!(flags & COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH))
- _cogl_framebuffer_flush_state (_cogl_get_framebuffer (), 0);
+ _cogl_framebuffer_flush_state (_cogl_get_draw_buffer (),
+ _cogl_get_read_buffer (),
+ 0);
}
/* This can be called directly by the CoglJournal to draw attributes