sdlGetRectEnclosingPoints function
Calculate a minimal rectangle enclosing a set of points.
If clip
is not NULL then only points inside of the clipping rectangle are
considered.
\param points an array of SDL_Point structures representing points to be
enclosed.
\param count the number of structures in the points
array.
\param clip an SDL_Rect used for clipping or NULL to enclose all points.
\param result an SDL_Rect structure filled in with the minimal enclosing
rectangle.
\returns true if any points were enclosed or false if all the points were
outside of the clipping rectangle.
\since This function is available since SDL 3.1.3.
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result)
Implementation
bool sdlGetRectEnclosingPoints(Pointer<SdlPoint> points, int count,
Pointer<SdlRect> clip, Pointer<SdlRect> result) {
final sdlGetRectEnclosingPointsLookupFunction = libSdl3.lookupFunction<
Uint8 Function(Pointer<SdlPoint> points, Int32 count,
Pointer<SdlRect> clip, Pointer<SdlRect> result),
int Function(Pointer<SdlPoint> points, int count, Pointer<SdlRect> clip,
Pointer<SdlRect> result)>('SDL_GetRectEnclosingPoints');
return sdlGetRectEnclosingPointsLookupFunction(points, count, clip, result) ==
1;
}