sdlHasIntersection function

bool sdlHasIntersection(
  1. Pointer<SdlRect> a,
  2. Pointer<SdlRect> b
)

Determine whether two rectangles intersect.

If either pointer is NULL the function will return SDL_FALSE.

\param A an SDL_Rect structure representing the first rectangle \param B an SDL_Rect structure representing the second rectangle \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.

\since This function is available since SDL 2.0.0.

\sa SDL_IntersectRect

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

Implementation

bool sdlHasIntersection(Pointer<SdlRect> a, Pointer<SdlRect> b) {
  final sdlHasIntersectionLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<SdlRect> a, Pointer<SdlRect> b),
      int Function(
          Pointer<SdlRect> a, Pointer<SdlRect> b)>('SDL_HasIntersection');
  return sdlHasIntersectionLookupFunction(a, b) == 1;
}