 | Hi,
I don't know if this is already in Allegro's DOC, but here goes.
I want to write something onto 'screen', but before I do, I want to
save the portion of the screen that will be overwritten.
What I mean is, I've created my own GUI routines, and when a dialog box is
activated, I want to save only the area of the screen the dialog covers. Once the
dialog box goes away, I want to put the original portion back.
How do I do this, without getting the entire screen, and doing a double buffer.
I only want to do a portion double buffer. Does this have anything to do with
sub bitmaps?
|
 |
Just create a bitmap and blit into it, here is a short example:
let w and h be dimensions of the dialog and x and y the location of it
temp_bmp = create_bitmap(w, h);
blit(screen, temp_bmp, x, y, 0, 0, w, h);
do the dialog
blit(temp_bmp, screen, 0, 0, x, y, w, h);
destroy_bitmap(temp_bmp);
I think you are going to have to add 1 or subtract one somewhere, but
don't remember where and whether you do have to.
|