delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/29/13:19:50

Reply-To: <arfa AT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>, "Deathifier" <storey AT tig DOT com DOT au>
Subject: RE: Some functions in Allegro I'm not sure of.
Date: Sat, 29 Aug 1998 18:19:11 +0100
Message-ID: <000201bdd371$2370c480$384e08c3@arthur>
MIME-Version: 1.0
Importance: Normal
In-Reply-To: <6s87mb$9hq$1@toto.tig.com.au>

> Hello,
> I'm trying to use the do_line() function in allegro, and I have a little
> problem with the arguments to pass to it, here's what it has in the manual
> (allegro.txt):
>
> void do_line(BITMAP *bmp, int x1, y1, x2, y2, int d, void (*proc)());
>    Calculates all the points along a line from point (x1, y1) to (x2, y2),
>    calling the supplied function for each one. This will be passed a copy of
>    the bmp parameter, the x and y position, and a copy of the d parameter,
>    so it is suitable for use with putpixel().
>
> I understand most of it, except for:
> int d
> void (*proc) ()
>
> I have no idea what the d parameter is supposed to be, or what the *proc
> function want's passed to it, I have tried using 0 and it doesn't work.  I'm
> sure someone knows what values to pass or what these mean so if you do,
> please help me out.

do_line() is the same as line() except that instead of using its own pixel plotting
command, it allows you to pass your own. You can pass the putpixel function as the
procedure to call and this will work in a similar way to line(). Why bother? So that
you can write your own texture mapping/interpolation routines, I imagine. I would
just stick with line(). If you don't know what do_line() does you don't need it.

BTW, I would try and ask the Allegro Mailing List this question. You may have more
luck there.

James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819

- Raw text -


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