sdlGetRectDisplayIndex function

int sdlGetRectDisplayIndex(
  1. Pointer<SdlRect> rect
)

Get the index of the display primarily containing a rect

\param rect the rect to query \returns the index of the display entirely containing the rect or closest to the center of the rect on success or a negative error code on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.24.0.

\sa SDL_GetDisplayBounds \sa SDL_GetNumVideoDisplays

extern DECLSPEC int SDLCALL SDL_GetRectDisplayIndex(const SDL_Rect * rect)

Implementation

int sdlGetRectDisplayIndex(Pointer<SdlRect> rect) {
  final sdlGetRectDisplayIndexLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<SdlRect> rect),
      int Function(Pointer<SdlRect> rect)>('SDL_GetRectDisplayIndex');
  return sdlGetRectDisplayIndexLookupFunction(rect);
}