chickadee » sdl2 » point-sub!

point-sub point1 point2procedure
point-sub! point1 point2 #!optional destprocedure

Efficiently subtract point2 from point1 (vector subtraction). The results will be clamped to the range -2147483648 to 2147483647.

If the dx and dy values are already held as separate variables instead, it is more efficient and convenient to negate the values and use point-move, instead of creating an sdl2:point.

  • point-sub returns a new managed sdl2:point.
  • point-sub! modifies and returns dest. If dest is omitted, point1 is modified and returned.

Requires sdl2 egg 0.2.0 or higher.