World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл SDL_rect.h

См. исходные тексты.

Классы

struct  SDL_Point
 The structure that defines a point (integer) Подробнее...
 
struct  SDL_FPoint
 The structure that defines a point (floating point) Подробнее...
 
struct  SDL_Rect
 A rectangle, with the origin at the upper left (integer). Подробнее...
 
struct  SDL_FRect
 A rectangle, with the origin at the upper left (floating point). Подробнее...
 

Определения типов

typedef struct SDL_Point SDL_Point
 The structure that defines a point (integer) Подробнее...
 
typedef struct SDL_FPoint SDL_FPoint
 The structure that defines a point (floating point) Подробнее...
 
typedef struct SDL_Rect SDL_Rect
 A rectangle, with the origin at the upper left (integer). Подробнее...
 
typedef struct SDL_FRect SDL_FRect
 A rectangle, with the origin at the upper left (floating point). Подробнее...
 

Функции

SDL_FORCE_INLINE SDL_bool SDL_PointInRect (const SDL_Point *p, const SDL_Rect *r)
 Returns true if point resides inside a rectangle. Подробнее...
 
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty (const SDL_Rect *r)
 Returns true if the rectangle has no area. Подробнее...
 
SDL_FORCE_INLINE SDL_bool SDL_RectEquals (const SDL_Rect *a, const SDL_Rect *b)
 Returns true if the two rectangles are equal. Подробнее...
 
DECLSPEC SDL_bool SDLCALL SDL_HasIntersection (const SDL_Rect *A, const SDL_Rect *B)
 Determine whether two rectangles intersect. Подробнее...
 
DECLSPEC SDL_bool SDLCALL SDL_IntersectRect (const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result)
 Calculate the intersection of two rectangles. Подробнее...
 
DECLSPEC void SDLCALL SDL_UnionRect (const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result)
 Calculate the union of two rectangles. Подробнее...
 
DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints (const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result)
 Calculate a minimal rectangle enclosing a set of points. Подробнее...
 
DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine (const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2)
 Calculate the intersection of a rectangle and line segment. Подробнее...
 

Подробное описание

Header file for SDL_rect definition and management functions.

См. определение в файле SDL_rect.h

Типы

◆ SDL_Point

typedef struct SDL_Point SDL_Point

The structure that defines a point (integer)

См. также
SDL_EnclosePoints
SDL_PointInRect

◆ SDL_FPoint

typedef struct SDL_FPoint SDL_FPoint

The structure that defines a point (floating point)

См. также
SDL_EnclosePoints
SDL_PointInRect

◆ SDL_Rect

typedef struct SDL_Rect SDL_Rect

A rectangle, with the origin at the upper left (integer).

См. также
SDL_RectEmpty
SDL_RectEquals
SDL_HasIntersection
SDL_IntersectRect
SDL_UnionRect
SDL_EnclosePoints

◆ SDL_FRect

typedef struct SDL_FRect SDL_FRect

A rectangle, with the origin at the upper left (floating point).

Функции

◆ SDL_PointInRect()

SDL_FORCE_INLINE SDL_bool SDL_PointInRect ( const SDL_Point p,
const SDL_Rect r 
)

Returns true if point resides inside a rectangle.

См. определение в файле SDL_rect.h строка 99

100 {
101  return ( (p->x >= r->x) && (p->x < (r->x + r->w)) &&
102  (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
103 }

Перекрестные ссылки SDL_FALSE и SDL_TRUE.

◆ SDL_RectEmpty()

SDL_FORCE_INLINE SDL_bool SDL_RectEmpty ( const SDL_Rect r)

Returns true if the rectangle has no area.

См. определение в файле SDL_rect.h строка 108

109 {
110  return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE;
111 }

Перекрестные ссылки SDL_FALSE и SDL_TRUE.

◆ SDL_RectEquals()

SDL_FORCE_INLINE SDL_bool SDL_RectEquals ( const SDL_Rect a,
const SDL_Rect b 
)

Returns true if the two rectangles are equal.

См. определение в файле SDL_rect.h строка 116

117 {
118  return (a && b && (a->x == b->x) && (a->y == b->y) &&
119  (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
120 }

Перекрестные ссылки SDL_FALSE и SDL_TRUE.

◆ SDL_HasIntersection()

DECLSPEC SDL_bool SDLCALL SDL_HasIntersection ( const SDL_Rect A,
const SDL_Rect B 
)

Determine whether two rectangles intersect.

Возвращает
SDL_TRUE if there is an intersection, SDL_FALSE otherwise.

◆ SDL_IntersectRect()

DECLSPEC SDL_bool SDLCALL SDL_IntersectRect ( const SDL_Rect A,
const SDL_Rect B,
SDL_Rect result 
)

Calculate the intersection of two rectangles.

Возвращает
SDL_TRUE if there is an intersection, SDL_FALSE otherwise.

◆ SDL_UnionRect()

DECLSPEC void SDLCALL SDL_UnionRect ( const SDL_Rect A,
const SDL_Rect B,
SDL_Rect result 
)

Calculate the union of two rectangles.

◆ SDL_EnclosePoints()

DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints ( const SDL_Point points,
int  count,
const SDL_Rect clip,
SDL_Rect result 
)

Calculate a minimal rectangle enclosing a set of points.

Возвращает
SDL_TRUE if any points were within the clipping rect

◆ SDL_IntersectRectAndLine()

DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine ( const SDL_Rect rect,
int *  X1,
int *  Y1,
int *  X2,
int *  Y2 
)

Calculate the intersection of a rectangle and line segment.

Возвращает
SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
p
GLfloat GLfloat p
Definition: SDL_opengl_glext.h:11093
SDL_FALSE
@ SDL_FALSE
Definition: SDL_stdinc.h:163
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1112
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
SDL_TRUE
@ SDL_TRUE
Definition: SDL_stdinc.h:164
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1112