On Mon, 30 Apr 2001, Andreas Beck wrote:
> If we clip at coordinate level, the returned buffer has a wrong geometry.
> 
> If we clip at pixel level and fill the out-of-clip pixels with some value -
> what value should we pick ?

Not that I think it's worth doing, but I would say that the "right thing 
to do" would be to clip at the coordinate level and change only those
values in the buffer that actually correspond to points inside the 
clip region, leaving the rest of the values unchanged.  (If the user 
wants them set to something, they are responsible for clearing the buffer 
before they do any Get* off the side of the clip rectangle.  If they
do not, it is their fault they get uninitialized areas.)

I can see one possible use for it: copying things from the
screen "seam" in games like sasteroids to move it in which
case you'd be able to do horribly lazy things like:

ggiGetBox(vis, ship.x, ship.y, ship.h, ship.w, buf);
ggiGetBox(vis, ship.x + virtx, ship.y + virty, ship.h, ship.w, buf);
ggiGetBox(vis, ship.x, ship.y + virty, ship.h, ship.w, buf);
ggiGetBox(vis, ship.x + virtx, ship.y, ship.h, ship.w, buf);
ship.x += ship.dx; ship.y += ship.dy;
if (ship.x > 0) ship.x -= virtx;
if (ship.y > 0) ship.y -= virty;
if (ship.x < -virtx) ship.x += virtx;
if (ship.y < -virty) ship.y += virty;
ggiPutBox(vis, ship.x, ship.y, ship.h, ship.w, buf);
ggiPutBox(vis, ship.x + virtx, ship.y + virty, ship.h, ship.w, buf);
ggiPutBox(vis, ship.x, ship.y + virty, ship.h, ship.w, buf);
ggiPutBox(vis, ship.x + virtx, ship.y, ship.h, ship.w, buf);

...instead of copying in two peices and figuring out all the 
adjustments for clipping yourself.

Other than that it doesn't strike me as particularly useful.

--
Brian

Reply via email to