Re: [AD] al_clear

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2009-03-12, Milan Mimica <milan.mimica@xxxxxxxxxx> wrote:
> Elias Pschernig wrote:
> > 
> > Next, this Allegro user wants to clear the screen each frame to avoid
> > droppings when he moves the image (or line). "al_clear_target_bitmap"
> > will likely not sound like it's the right function. So that's what I
> > meant, it's technical naming. I'd be fine with that - but I'd prefer
> > al_clear_screen (or something like that), it's just a "nicer" name.

At some stage (soon) the user will learn about al_set_target_bitmap().
al_clear_target_bitmap() should sound right then.

> 
> Let's have a function:
> void al_clear_screen() { // or rather al_clear_bakbuffer()
>    old = al_get_target_bitmap();
>    al_set_target_bitmap(al_get_backbuffer());
>    al_clear_target_bitmap();
>    if (old != al_get_backbuffer())
>      al_set_target_bitmap(old);
> }
> 
> and make a promise we won't do this with every drawing function.

I don't think it's very useful to clear the backbuffer while keeping
the target bitmap as something else.  Usually you'd clear the backbuffer
as a precursor to drawing onto it.

Peter





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/