[cairo] Clear Screen command?

Benjamin Otte otte at redhat.com
Thu May 27 23:16:23 PDT 2010

You want to have a look at cairo_operator_t and the cairo_set_operator()

A clear is easily achieved using CAIRO_OPERATOR_CLEAR and cairo_paint().
Though as someone already pointed out, you likely want to not clear your
screen but instead cairo_paint() the buffer on it using


On Fri, 2010-05-28 at 11:47 +0800, Mj Mendoza IV wrote:
> Hello,
> Coming from _BitBlt_ methodology of creating 2D games, what is the
> equivalent of _clear screen_ on Cairo?
> On rastered type of rendering engine, the pseudo code would be:
> while app is running
>   clear screen
>     draw stuff to buffer
>   draw buffer to screen
> end while
> How is this logic applied when using cairo library? Is it safe to
> simply FILL the whole area of  the main context with color black (or
> any color that is)?
> Regards.
> Mj Mendoza IV,
> Developer, KonsolScript
> http://www.konsolscript.org
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

More information about the cairo mailing list