sdlIntersectFRect function
Calculate the intersection of two rectangles with float precision.
If result
is NULL then this function will return SDL_FALSE.
\param A an SDL_FRect structure representing the first rectangle
\param B an SDL_FRect structure representing the second rectangle
\param result an SDL_FRect structure filled in with the intersection of
rectangles A
and B
\returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
\since This function is available since SDL 2.0.22.
\sa SDL_HasIntersectionF
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRect(const SDL_FRect * A, const SDL_FRect * B, SDL_FRect * result)
Implementation
bool sdlIntersectFRect(
Pointer<SdlFRect> a, Pointer<SdlFRect> b, Pointer<SdlFRect> result) {
final sdlIntersectFRectLookupFunction = libSdl2.lookupFunction<
Int32 Function(
Pointer<SdlFRect> a, Pointer<SdlFRect> b, Pointer<SdlFRect> result),
int Function(Pointer<SdlFRect> a, Pointer<SdlFRect> b,
Pointer<SdlFRect> result)>('SDL_IntersectFRect');
return sdlIntersectFRectLookupFunction(a, b, result) == 1;
}