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:
@ -138,7 +138,7 @@
|
||||
#include "cogl-texture-private.h"
|
||||
#include "cogl-material-private.h"
|
||||
#include "cogl-primitives.h"
|
||||
#include "cogl-draw-buffer-private.h"
|
||||
#include "cogl-framebuffer-private.h"
|
||||
|
||||
#define PAD_FOR_ALIGNMENT(VAR, TYPE_SIZE) \
|
||||
(VAR = TYPE_SIZE + ((VAR - 1) & ~(TYPE_SIZE - 1)))
|
||||
@ -1666,10 +1666,10 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer)
|
||||
}
|
||||
ctx->n_texcoord_arrays_enabled = max_texcoord_attrib_unit + 1;
|
||||
|
||||
/* NB: _cogl_draw_buffer_flush_state may disrupt various state (such
|
||||
/* NB: _cogl_framebuffer_flush_state may disrupt various state (such
|
||||
* as the material state) when flushing the clip stack, so should
|
||||
* always be done first when preparing to draw. */
|
||||
_cogl_draw_buffer_flush_state (_cogl_get_draw_buffer (), 0);
|
||||
_cogl_framebuffer_flush_state (_cogl_get_framebuffer (), 0);
|
||||
|
||||
options.flags =
|
||||
COGL_MATERIAL_FLUSH_FALLBACK_MASK |
|
||||
|
Reference in New Issue
Block a user