cogl: deprecate cogl_draw_buffer API and replace with a cogl_framebuffer API

cogl_push_draw_buffer, cogl_set_draw_buffer and cogl_pop_draw_buffer are now
deprecated and new code should use the new cogl_framebuffer_* API instead.

Code that previously did:
    cogl_push_draw_buffer ();
    cogl_set_draw_buffer (COGL_OFFSCREEN_BUFFER, buffer);
    /* draw */
    cogl_pop_draw_buffer ();
should now be re-written as:
    cogl_push_framebuffer (buffer);
    /* draw */
    cogl_pop_framebuffer ();

As can be seen from the example above the rename has been used as an
opportunity to remove the redundant target argument from
cogl_set_draw_buffer; it now only takes one call to redirect to an offscreen
buffer, and finally the term framebuffer may be a bit more familiar to
anyone coming from an OpenGL background.
This commit is contained in:
Robert Bragg
2009-11-26 19:06:35 +00:00
parent 7fee8a309b
commit 944423a8d9
14 changed files with 414 additions and 353 deletions

View File

@ -33,7 +33,7 @@
#include "cogl-context.h"
#include "cogl-internal.h"
#include "cogl-matrix-stack.h"
#include "cogl-draw-buffer-private.h"
#include "cogl-framebuffer-private.h"
typedef struct {
CoglMatrix matrix;
@ -426,11 +426,11 @@ _cogl_matrix_stack_flush_to_gl (CoglMatrixStack *stack,
}
/* Because Cogl defines texture coordinates to have a top left origin and
* because offscreen draw buffers may be used for rendering to textures we
* because offscreen framebuffers may be used for rendering to textures we
* always render upside down to offscreen buffers.
*/
if (mode == COGL_MATRIX_PROJECTION &&
cogl_is_offscreen (_cogl_get_draw_buffer ()))
cogl_is_offscreen (_cogl_get_framebuffer ()))
{
CoglMatrix flipped_projection;
CoglMatrix *projection =