sdlxGetDisplayForPoint function video

int sdlxGetDisplayForPoint(
  1. SdlxPoint point
)

Get the display containing a point.

\param point the point to query. \returns the instance ID of the display containing the point or 0 on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.2.0.

\sa SDL_GetDisplayBounds \sa SDL_GetDisplays

extern SDL_DECLSPEC SDL_DisplayID SDLCALL SDL_GetDisplayForPoint(const SDL_Point *point)

Implementation

int sdlxGetDisplayForPoint(SdlxPoint point) {
  final pointPointer = calloc<SdlPoint>();
  pointPointer.ref
    ..x = point.x
    ..y = point.y;
  final result = sdlGetDisplayForPoint(pointPointer);
  pointPointer.callocFree();
  return result;
}