sdlGetRenderClipRect function

bool sdlGetRenderClipRect(
  1. Pointer<SdlRenderer> renderer,
  2. Pointer<SdlRect> rect
)

Get the clip rectangle for the current target.

\param renderer the rendering context. \param rect an SDL_Rect structure filled in with the current clipping area or an empty rectangle if clipping is disabled. \returns true on success or false 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.1.3.

\sa SDL_RenderClipEnabled \sa SDL_SetRenderClipRect

extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect)

Implementation

bool sdlGetRenderClipRect(
    Pointer<SdlRenderer> renderer, Pointer<SdlRect> rect) {
  final sdlGetRenderClipRectLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlRenderer> renderer, Pointer<SdlRect> rect),
      int Function(Pointer<SdlRenderer> renderer,
          Pointer<SdlRect> rect)>('SDL_GetRenderClipRect');
  return sdlGetRenderClipRectLookupFunction(renderer, rect) == 1;
}