Re: [AD] clipping line algorithm

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> I was under the impression that _putpixel assumed the coordinates were
> within the bitmap. If this is the case, you cannot give _putpixel to the
> normal line function becuase it will crash when writing pixels outside
> the bitmap. clipline guarantees all pixels will be inside the bitmap and
> this is why I used it. Am I wrong about _putpixel?

No, you aren't. But you are making assumptions on the types of bitmaps you 
draw onto. The drawing primitives are pretty generic: you can call them for 
any types of bitmaps, provided that they basically have a valid 
bmp->vtable->putpixel method.

One could imagine that the bitmap is an abstraction for your printer: by 
calling line() on it, you print a line.

> Also, what exactly is the difference between putpixel and
> bmp->vtable->putpixel?

Basically none. putpixel is an alias for bmp->vtable->putpixel (see 
include/allegro/inline/draw.inl)

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/