Go to the source code of this file.
Functions | |
| DECLSPEC bool | pointInRect (const SDL_Rect &r, int x, int y) |
| DECLSPEC void | setRectEmpty (SDL_Rect &r) |
| DECLSPEC bool | isRectEmpty (const SDL_Rect &r) |
| DECLSPEC void | offsetRect (SDL_Rect &r, int dx, int dy) |
| DECLSPEC void | setRect (SDL_Rect &r, int x, int y, int w, int h) |
| DECLSPEC void | inflateRect (SDL_Rect &r, int dx, int dy) |
| DECLSPEC void | intersectRect (SDL_Rect &r, const SDL_Rect &r2) |
Required header file:
#include <functions.h>
| DECLSPEC void inflateRect | ( | SDL_Rect & | r, | |
| int | dx, | |||
| int | dy | |||
| ) |
Resizes a rect, the rect's center will not change.
| r | The rect to resize | |
| dx | The value to change the left and right borders, negative to make it smaller | |
| dy | The value to change the top and bottom borders, negative to make it smaller |
| DECLSPEC void intersectRect | ( | SDL_Rect & | r, | |
| const SDL_Rect & | r2 | |||
| ) |
Intersects two rects and assignes the intersected area to r.
| r | One rect, the result will be assigned to this | |
| r2 | The other rect, is stays unaffected |
| DECLSPEC bool isRectEmpty | ( | const SDL_Rect & | r | ) |
Prooves whether a rect is empty or not
| r | The rect to proove |
| DECLSPEC void offsetRect | ( | SDL_Rect & | r, | |
| int | dx, | |||
| int | dy | |||
| ) |
Moves a rect
| r | The rect to move | |
| dx | The distance to move in x-direction, negative to move to the left | |
| dy | The distance to move in y-direction, negative to move to the top |
| DECLSPEC bool pointInRect | ( | const SDL_Rect & | r, | |
| int | x, | |||
| int | y | |||
| ) |
Prooves whether a point is inside a rect, or not.
| r | The rect | |
| x | The x coordinate of the point | |
| y | The y coordinate of the point |
| DECLSPEC void setRect | ( | SDL_Rect & | r, | |
| int | x, | |||
| int | y, | |||
| int | w, | |||
| int | h | |||
| ) |
Sets all of the rect's data.
| r | A reference to the rect | |
| x | the x coordinate | |
| y | the y coordinate | |
| w | the width | |
| h | the height |
| DECLSPEC void setRectEmpty | ( | SDL_Rect & | r | ) |
Makes a rect invalid by setting x and y to -1 and w and h to 0.
| r | The rect to empty |
1.5.1