Utilities for users.
More...
|
| #define | pico_assert(x) |
| | Asserts condition and shows SDL error on failure.
|
|
| Pico_Dim | pico_dim (Pico_Pct pct) |
| | Returns a size relative to the screen size.
|
| Pico_Dim | pico_dim_ext (Pico_Pct pct, Pico_Dim d) |
| | Returns a size relative to the given rectangle's size.
|
| int | pico_pos_vs_rect (Pico_Pos pt, Pico_Rect r) |
| | Checks if a point is inside a rectangle. Assumes that both primitives use the same anchor.
|
| int | pico_pos_vs_rect_ext (Pico_Pos pt, Pico_Rect r, Pico_Anchor ap, Pico_Anchor ar) |
| | Checks if a point is inside a rectangle.
|
| Pico_Pos | pico_pos (Pico_Pct pct) |
| | Returns a coordinate relative to the screen rectangle.
|
| Pico_Pos | pico_pos_ext (Pico_Pct pct, Pico_Rect r, Pico_Anchor anc) |
| | Returns a coordinate relative to the given rectangle's position.
|
| int | pico_rect_vs_rect (Pico_Rect r1, Pico_Rect r2) |
| | Checks if two rectangles overlap. Assumes that both rectangles use the same anchor.
|
| int | pico_rect_vs_rect_ext (Pico_Rect r1, Pico_Rect r2, Pico_Anchor a2, Pico_Anchor a1) |
| | Checks if two rectangles with different anchors overlap.
|
Utilities for users.
◆ pico_assert
Value:if (!(x)) { fprintf(stderr,"%s\n",SDL_GetError()); assert(0 && "SDL ERROR"); }
Asserts condition and shows SDL error on failure.
- Parameters
-
◆ pico_dim()
Returns a size relative to the screen size.
- Parameters
-
| pct | percentage (may be out of [0,100]) |
- See also
- pico_dim_ext
◆ pico_dim_ext()
Returns a size relative to the given rectangle's size.
- Parameters
-
| pct | percentage (may be out of [0,100]) |
| dim | the reference rectangle |
- See also
- pico_dim
◆ pico_pos()
Returns a coordinate relative to the screen rectangle.
- Parameters
-
| pct | percentage (may be out of [0,100]) |
- See also
- pico_pos_ext
◆ pico_pos_ext()
Returns a coordinate relative to the given rectangle's position.
- Parameters
-
| pct | percentage (may be out of [0,100]) |
| r | the reference rectangle |
| anc | anchor for r |
- See also
- pico_pos
◆ pico_pos_vs_rect()
Checks if a point is inside a rectangle. Assumes that both primitives use the same anchor.
- Parameters
-
- Returns
- 1 if pt is inside r, or 0 otherwise
◆ pico_pos_vs_rect_ext()
Checks if a point is inside a rectangle.
- Parameters
-
| pt | point |
| r | rectangle |
| ap | anchor for pt |
| ar | anchor for r |
- Returns
- 1 if pt is inside r, or 0 otherwise
◆ pico_rect_vs_rect()
Checks if two rectangles overlap. Assumes that both rectangles use the same anchor.
- Parameters
-
| r1 | rectangle 1 |
| r2 | rectangle 2 |
- Returns
- 1 if r1 and r2 overlap, or 0 otherwise
- See also
- pico_rect_vs_rect_ext
◆ pico_rect_vs_rect_ext()
Checks if two rectangles with different anchors overlap.
- Parameters
-
| r1 | rectangle 1 |
| r2 | rectangle 2 |
| a1 | anchor for r1 |
| a2 | anchor for r2 |
- Returns
- 1 if r1 and r2 overlap, or 0 otherwise
- See also
- pico_pos_vs_rect