chickadee » sdl2 » intersect-rect

intersect-rect rect1 rect2 #!optional result-rectprocedure

Calculates the intersection of rect1 and rect2. See SDL_IntersectRect.

If result-rect is omitted or #f, a new managed sdl2:rect will be returned. If result-rect is an sdl2:rect, it will be modified and returned. It is safe for result-rect to be the same object as rect1 or rect2, in which case rect1 or rect2 will be modified and returned. It is safe (but useless) for rect1 and rect2 to be the same object.

This procedure returns multiple values:

rect
An sdl2:rect of the intersection of rect1 and rect2. This will be the same object as result-rect, if result-rect was specified.
intersect?
#t if rect1 and rect2 intersect, otherwise #f