SDL
2.0
|
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_pixels.h"
#include "SDL_rwops.h"
#include "begin_code.h"
#include "close_code.h"
Go to the source code of this file.
Data Structures | |
struct | SDL_Point |
The structure that defines a point. More... | |
struct | SDL_Rect |
A rectangle, with the origin at the upper left. More... | |
Functions | |
SDL_FORCE_INLINE SDL_bool | SDL_PointInRect (const SDL_Point *p, const SDL_Rect *r) |
Returns true if point resides inside a rectangle. More... | |
SDL_FORCE_INLINE SDL_bool | SDL_RectEmpty (const SDL_Rect *r) |
Returns true if the rectangle has no area. More... | |
SDL_FORCE_INLINE SDL_bool | SDL_RectEquals (const SDL_Rect *a, const SDL_Rect *b) |
Returns true if the two rectangles are equal. More... | |
SDL_bool | SDL_HasIntersection (const SDL_Rect *A, const SDL_Rect *B) |
Determine whether two rectangles intersect. More... | |
SDL_bool | SDL_IntersectRect (const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result) |
Calculate the intersection of two rectangles. More... | |
void | SDL_UnionRect (const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result) |
Calculate the union of two rectangles. More... | |
SDL_bool | SDL_EnclosePoints (const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result) |
Calculate a minimal rectangle enclosing a set of points. More... | |
SDL_bool | SDL_IntersectRectAndLine (const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2) |
Calculate the intersection of a rectangle and line segment. More... | |
Header file for SDL_rect definition and management functions.
Definition in file SDL_rect.h.
SDL_bool SDL_EnclosePoints | ( | const SDL_Point * | points, |
int | count, | ||
const SDL_Rect * | clip, | ||
SDL_Rect * | result | ||
) |
Calculate a minimal rectangle enclosing a set of points.
Definition at line 192 of file SDL_rect.c.
References SDL_Rect::h, i, NULL, SDL_FALSE, SDL_InvalidParamError, SDL_RectEmpty(), SDL_TRUE, SDL_Rect::w, SDL_Point::x, SDL_Rect::x, SDL_Point::y, and SDL_Rect::y.
Referenced by SDL_RectEquals().
Determine whether two rectangles intersect.
Definition at line 28 of file SDL_rect.c.
References SDL_Rect::h, SDL_FALSE, SDL_InvalidParamError, SDL_RectEmpty(), SDL_TRUE, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_RectEquals().
Calculate the intersection of two rectangles.
Definition at line 75 of file SDL_rect.c.
References SDL_Rect::h, SDL_FALSE, SDL_InvalidParamError, SDL_RectEmpty(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_RectEquals().
Calculate the intersection of a rectangle and line segment.
Definition at line 317 of file SDL_rect.c.
References CODE_BOTTOM, CODE_LEFT, CODE_RIGHT, CODE_TOP, ComputeOutCode(), SDL_Rect::h, SDL_assert, SDL_FALSE, SDL_InvalidParamError, SDL_RectEmpty(), SDL_TRUE, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_RectEquals().
SDL_FORCE_INLINE SDL_bool SDL_PointInRect | ( | const SDL_Point * | p, |
const SDL_Rect * | r | ||
) |
Returns true if point resides inside a rectangle.
Definition at line 73 of file SDL_rect.h.
References SDL_Rect::h, SDL_FALSE, SDL_TRUE, SDL_Rect::w, SDL_Point::x, SDL_Rect::x, SDL_Point::y, and SDL_Rect::y.
Referenced by hitTest().
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty | ( | const SDL_Rect * | r | ) |
Returns true if the rectangle has no area.
Definition at line 82 of file SDL_rect.h.
References SDL_Rect::h, SDL_FALSE, SDL_TRUE, and SDL_Rect::w.
Referenced by rect_testIntersectRectEmpty(), rect_testRectEmpty(), rect_testRectEmptyParam(), SDL_EnclosePoints(), SDL_FillRect(), SDL_HasIntersection(), SDL_IntersectRect(), SDL_IntersectRectAndLine(), SDL_SoftBlit(), SDL_UnionRect(), and SDLTest_CommonEvent().
SDL_FORCE_INLINE SDL_bool SDL_RectEquals | ( | const SDL_Rect * | a, |
const SDL_Rect * | b | ||
) |
Returns true if the two rectangles are equal.
Definition at line 90 of file SDL_rect.h.
References DECLSPEC, SDL_Rect::h, rect, SDL_EnclosePoints(), SDL_FALSE, SDL_HasIntersection(), SDL_IntersectRect(), SDL_IntersectRectAndLine(), SDL_TRUE, SDL_UnionRect(), SDLCALL, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by rect_testRectEquals(), and rect_testRectEqualsParam().
Calculate the union of two rectangles.
Definition at line 129 of file SDL_rect.c.
References SDL_Rect::h, SDL_InvalidParamError, SDL_RectEmpty(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_RectEquals().