Skip to content

Commit 7670982

Browse files
authored
Merge pull request odin-lang#5766 from rope-hmg/master
Added PointInRectFloat to SDL3
2 parents 227be05 + 65acbe1 commit 7670982

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vendor/sdl3/sdl3_rect.odin

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ PointInRect :: proc "c" (p: Point, r: Rect) -> bool {
2929
(p.y >= r.y) && (p.y < (r.y + r.h)) )
3030
}
3131

32+
@(require_results)
33+
PointInRectFloat :: proc "c" (p: FPoint, r: FRect) -> bool {
34+
return ( (p.x >= r.x) && (p.x <= (r.x + r.w)) &&
35+
(p.y >= r.y) && (p.y <= (r.y + r.h)) )
36+
}
37+
3238
@(require_results)
3339
RectEmpty :: proc "c" (r: Rect) -> bool {
3440
return r.w <= 0 || r.h <= 0

0 commit comments

Comments
 (0)