Module rect

Available on crate feature dep_sdl3 only.
Expand description

Some helper functions for managing rectangles and 2D points, in both integer and floating point versions.

Structs§

SDL_FPoint
The structure that defines a point (using floating point values).
SDL_FRect
A rectangle, with the origin at the upper left (using floating point values).
SDL_Point
The structure that defines a point (using integers).
SDL_Rect
A rectangle, with the origin at the upper left (using integers).

Functions§

SDL_GetRectAndLineIntersection
Calculate the intersection of a rectangle and line segment.
SDL_GetRectAndLineIntersectionFloat
Calculate the intersection of a rectangle and line segment with float precision.
SDL_GetRectEnclosingPoints
Calculate a minimal rectangle enclosing a set of points.
SDL_GetRectEnclosingPointsFloat
Calculate a minimal rectangle enclosing a set of points with float precision.
SDL_GetRectIntersection
Calculate the intersection of two rectangles.
SDL_GetRectIntersectionFloat
Calculate the intersection of two rectangles with float precision.
SDL_GetRectUnion
Calculate the union of two rectangles.
SDL_GetRectUnionFloat
Calculate the union of two rectangles with float precision.
SDL_HasRectIntersection
Determine whether two rectangles intersect.
SDL_HasRectIntersectionFloat
Determine whether two rectangles intersect with float precision.
SDL_PointInRect
Determine whether a point resides inside a rectangle.
SDL_PointInRectFloat
Determine whether a point resides inside a floating point rectangle.
SDL_RectEmpty
Determine whether a rectangle has no area.
SDL_RectEmptyFloat
Determine whether a floating point rectangle can contain any point.
SDL_RectToFRect
Convert an SDL_Rect to SDL_FRect
SDL_RectsEqual
Determine whether two rectangles are equal.
SDL_RectsEqualEpsilon
Determine whether two floating point rectangles are equal, within some given epsilon.
SDL_RectsEqualFloat
Determine whether two floating point rectangles are equal, within a default epsilon.