examples: use cogl_framebuffer_clear4f not cogl_clear

cogl_clear depends on the default CoglContext which we are trying to
steer the API away from requiring. cogl_framebuffer_clear4f is
explicitly passed a framebuffer pointer which is implicitly related to a
specific context.

This updates all the examples to use cogl_framebuffer_clear4f instead of
cogl_clear and removes any redundant CoglColor that was previously
passed to cogl_clear.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Robert Bragg
2012-01-07 23:28:36 +00:00
parent cdbc1dc9b1
commit 7287dd1faf
7 changed files with 12 additions and 24 deletions

View File

@ -19,8 +19,6 @@
#define TFP_XWIN_WIDTH 200
#define TFP_XWIN_HEIGHT 200
CoglColor black;
static void
update_cogl_x11_event_mask (CoglOnscreen *onscreen,
guint32 event_mask,
@ -216,7 +214,7 @@ main (int argc, char **argv)
XFillRectangle (xdpy, tfp_xwin, gc, 0, 0, TFP_XWIN_WIDTH, TFP_XWIN_HEIGHT);
XFlush (xdpy);
cogl_clear (&black, COGL_BUFFER_BIT_COLOR);
cogl_framebuffer_clear4f (fb, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1);
cogl_set_source_texture (tfp);
cogl_rectangle (-0.8, 0.8, 0.8, -0.8);
cogl_framebuffer_swap_buffers (fb);