delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/11/11:47:55

From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Blit Question!
Date: 11 Jan 2000 14:54:04 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 41
Message-ID: <85fg6c$bv9$1@antares.lu.erisoft.se>
References: <3872A91F DOT 103CE108 AT sympatico DOT ca>
NNTP-Posting-Host: spica-144.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019