getClipRect method

Rectangle<double> getClipRect()

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)

{@category surface}

Implementation

math.Rectangle<double> getClipRect() {
  final rectPointer = calloc<SdlRect>();
  sdlGetSurfaceClipRect(this, rectPointer);
  final result = rectPointer.create();
  calloc.free(rectPointer);
  return result;
}