[cairo] Clear Screen command?

Maarten Bosmans mkbosmans at gmail.com
Thu May 27 22:55:45 PDT 2010


2010/5/28 Mj Mendoza IV <mjmendoza at konsolscript.org>:
> 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

I'm wondering why you would want to clear the screen first. Wouldn't
drawing the buffer to the screen overwrite any existing content?

If I understand your procedure correctly, this approach would cause
screen flicker, because drawing stuff to the buffer takes some time.

> 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


More information about the cairo mailing list