Re: [AD] New clipping API

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


> > I think the new sentence in the patch implicitly says that it's
> > supported, since it explicitly talks about the intersection of the
> > clipping rectangle with the actual surface.
>
> Ah.

Why do I have an impression of skepticism here? :-)

> > Do you think we should be more explicit?
>
> I think so.

Ok, here's the new wording:

   Each bitmap has an associated clipping rectangle, which is the area of 
   the image it is ok to draw onto. Nothing will be drawn to positions
   outside this space. This function sets the clipping rectangle for the
   specified bitmap. Pass the coordinates of the top-left and bottom-right
   corners of the clipping rectangle in this order; these are both inclusive,
   i.e. set_clip_rect(bitmap, 16, 16, 32, 32) will allow drawing to (16, 16)
   and (32, 32), but not to (15, 15) and (33, 33).

   Drawing operations will be performed (at least partially) on the bitmap as
   long as the first coordinates of its clipping rectangle are not greater
   than the second coordinates and its intersection with the actual image
   is non-empty. If either condition is not fulfilled, drawing will be turned
   off for the bitmap, e.g.
<codeblock>
      set_clip_rect(bmp, 0, 0, -1, -1); /* disable drawing on bmp 
*/<endblock>

   Note that passing "out-of-bitmap" coordinates is allowed, but they are
   likely to be altered for the sake of internal consistency (and, therefore,
   won't likely be returned unmodified by get_clip_rect). However, such a
   modification is guaranteed to preserve the external effect of the clipping
   rectangle, that is not to modify the actual area of the image it is ok to
   draw into.

-- 
Eric Botcazou




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