[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2002-11-02, Eric <ebotcazou@xxxxxxxxxx> wrote:
> The attached patch is a reworked version of a long pending patch from Vincent.
> It adds the get_clip() function that retrieves the clipping rectangle of a
> bitmap. I agree with Vincent that the function is needed because of the +1
> tweak on the right and bottom clipping values.
> +/* get_clip:
> + * Returns the clipping rectangle of the bitmap. The function follows the
> + * semantics of set_clip() in that it returns zero for x1, y1, x2 and y2
> + * when clipping is turned off.
> + */
I think it's really time we depreciated set_clip() and its weird
semantics. Here is a proposal.
void set_clip_ex(BITMAP *bitmap, int x, int y, int w, int h);
Set the clipping rectangle of a bitmap.
Nothing special wrt to 0, 0, 0, 0.
void get_clip(BITMAP *bitmap, int *rx, int *ry, int *rw, int *rh);
Get the clipping rectangle of a bitmap.
void enable_clipping(BITMAP *bitmap);
void disable_clipping(BITMAP *bitmap);
Doesn't modify the clipping rectangle.
int clipping_enabled(BITMAP *bitmap);
Returns true if clipping enabled on this bitmap.
--
王浩禎