sdlGetSurfaceClipRect function surface

bool sdlGetSurfaceClipRect(
  1. Pointer<SdlSurface> surface,
  2. Pointer<SdlRect> rect
)

Get the clipping rectangle for a surface.

When surface is the destination of a blit, only the area within the clip rectangle is drawn into.

\param surface the SDL_Surface structure representing the surface to be clipped. \param rect an SDL_Rect structure filled in with the clipping rectangle for the surface. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function is not thread safe.

\since This function is available since SDL 3.2.0.

\sa SDL_SetSurfaceClipRect

extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect)

Implementation

bool sdlGetSurfaceClipRect(Pointer<SdlSurface> surface, Pointer<SdlRect> rect) {
  final sdlGetSurfaceClipRectLookupFunction = _libSdl
      .lookupFunction<
        Uint8 Function(Pointer<SdlSurface> surface, Pointer<SdlRect> rect),
        int Function(Pointer<SdlSurface> surface, Pointer<SdlRect> rect)
      >('SDL_GetSurfaceClipRect');
  return sdlGetSurfaceClipRectLookupFunction(surface, rect) == 1;
}