mirror of
https://github.com/love2d/megasource.git
synced 2026-08-17 11:11:35 +02:00
Added SDL 1c0f6952e65e.
This commit is contained in:
@@ -43,6 +43,7 @@ extern "C" {
|
||||
* \brief The structure that defines a point
|
||||
*
|
||||
* \sa SDL_EnclosePoints
|
||||
* \sa SDL_PointInRect
|
||||
*/
|
||||
typedef struct SDL_Point
|
||||
{
|
||||
@@ -66,6 +67,15 @@ typedef struct SDL_Rect
|
||||
int w, h;
|
||||
} SDL_Rect;
|
||||
|
||||
/**
|
||||
* \brief Returns true if point resides inside a rectangle.
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
|
||||
{
|
||||
return ( (p->x >= r->x) && (p->x < (r->x + r->w)) &&
|
||||
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Returns true if the rectangle has no area.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user