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.

\since This function is available since SDL 3.1.3.

\sa SDL_SetSurfaceClipRect

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

Implementation

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