slutpet/sdl.c
2025-05-28 18:57:21 +10:00

17 lines
333 B
C

#include <SDL3/SDL.h>
#include "dat.h"
#include "fns.h"
int
in_bounds(Image *i, int x, int y, SDL_Rect *bounds)
{
SDL_Rect r;
SDL_Rect irect = { x, y, i->w, i->h };
if (SDL_GetRectUnion(&irect, bounds, &r) == false) {
shit("rect union math fail: %s", SDL_GetError());
return false;
}
return SDL_RectsEqual(&irect, &r);
}