Re: [AD] scanline extension |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
tom st denis wrote :
>
> ok I gave it more thought... lets use this...
>
> typedef struct {
> BITMAP *dest, /* destination bitmap */
> *txt; /* texture map if any */
> int x1, x2, /* x start and end coords */
> y, /* line to draw on */
> u1, u2, /* texture x start/end */
> v1, v2, /* texture y start/end */
> c1, c2; /* color start/end */
> float z1,z2; /* scanline start/end Z */
> } scanlineinfo;
>
> void draw_scanline(scanlineinfo *sli);
>
> Then you tell allegro
>
> add_scanline_drawer(&draw_scanline, MYTYPE)
>
> Where MYTYPE is an integer.
You are reinventing the wheel :-) If you take a look at iscan.s (ASM
rendering func) or cscan.h (C rendering func) you'll see that :
1. The struct you are talking about already exists : it is called
POLYGON_SEGMENT (declared in private headers file
include/allegro/aintern.h)
2. The actual rendering functions are declared this way :
void _poly_scanline_the_mode(unsigned long addr, int w, POLYGON_SEGMENT
*info)
where - addr is the BITMAP address where the scanline will be rendered
- w is the scanline width
- info is the structure which contains (u, du, v, dv, c, dc,
texture address, etc...)
Bertrand.