SDL Wiki
(This is the documentation for SDL3, which is the current stable version. SDL2 was the previous version!)

SDL_GetRectEnclosingPoints

Calculate a minimal rectangle enclosing a set of points.

Header File

Defined in <SDL3/SDL_rect.h>

Syntax

bool SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result);

Function Parameters

const SDL_Point * points an array of SDL_Point structures representing points to be enclosed.
int count the number of structures in the points array.
const SDL_Rect * clip an SDL_Rect used for clipping or NULL to enclose all points.
SDL_Rect * result an SDL_Rect structure filled in with the minimal enclosing rectangle.

Return Value

(bool) Returns true if any points were enclosed or false if all the points were outside of the clipping rectangle.

Remarks

If clip is not NULL then only points inside of the clipping rectangle are considered.

Version

This function is available since SDL 3.1.3.


CategoryAPI, CategoryAPIFunction, CategoryRect


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.