Re: [AD] Preparing for RC2

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


On Saturday 27 August 2005 03:47 am, Elias Pschernig wrote:
> Actually, there would be valid reasons to draw to a memory buffer, for
> example:
>
> blit(background, buffer, ...)
> ...
> show_mouse(buffer)
> while(1) {
>     ...
>     blit(buffer, screen, ...)
> }

Or:

blit(background, buffer, ...)
...
tmp_buf = create_bitmap(mouse_sprite->w, mouse_sprite->h);
while(1) {
    ...
    blit(buffer, tmp_buf, mouse_x, mouse_y, 0, 0, tmp_buf->w, tmp_buf->h);
    draw_sprite(buffer, mouse_sprite, mouse_x, mouse_y);
    blit(buffer, screen, ...)
    blit(tmp_buf, buffer, 0, 0, mouse_x, mouse_y, tmp_buf->w, tmp_buf->h);
}

Safer since it can't blit in the middle of a tiemr update, and a bit faster 
since it's less complex (no updating when it's not showing, and none of that 
flicker-free code needed for the screen).

But as for the patch.. I think using a memory bitmap should be the same as 
using NULL. I don't think just returning would be the best thing to do.




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