Mail Archives: djgpp/1998/08/29/13:19:50
> 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 -