Mail Archives: djgpp/2000/01/11/11:47:55
BRAD MURPHY (bjmurphy AT sympatico DOT ca) wrote:
: I am currently learning allegro and I was wondering if anyone could
: give me a some help with blit. I've read the allegro.txt definition,
: but some things are still not clicking. The code that i'm working with
: is:
: circlefill(dblbuffer, 0, 100, 50, 15); /* draw first time */
This paints a cirlce.
: vsync();
: blit(dblbuffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H); // blit 1
This shows the circle on the screen.
: for (x = 1; x < 320; x++) {
: rest(10); /* slow it down so we can see it */
: circlefill(dblbuffer, x - 1, 100, 50, 0); /* erase from last place */
This paints a circle in the exact same place as on is already painted.
Note that the first time in the loop the second argument is x - 1 ==
0. Cf. the first code line
: circlefill(dblbuffer, x, 100, 50, 15); /* redraw at new place */
This paints a circle in a place a little shifted in some direction.
: textout(dblbuffer, font, "Double buffering (mode 13h)", 0, 0, 15);
: vsync();
: blit(dblbuffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H); // blit 2
This shows the doubly painted circle (which is equal to none) and the
newly painted circle.
: }
Right,
MartinS
- Raw text -