sdlRenderFillRect function

bool sdlRenderFillRect(
  1. Pointer<SdlRenderer> renderer,
  2. Pointer<SdlFRect> rect
)

Fill a rectangle on the current rendering target with the drawing color at subpixel precision.

\param renderer the renderer which should fill a rectangle. \param rect a pointer to the destination rectangle, or NULL for the entire rendering target. \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_RenderFillRects

extern SDL_DECLSPEC bool SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect)

Implementation

bool sdlRenderFillRect(Pointer<SdlRenderer> renderer, Pointer<SdlFRect> rect) {
  final sdlRenderFillRectLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlRenderer> renderer, Pointer<SdlFRect> rect),
      int Function(Pointer<SdlRenderer> renderer,
          Pointer<SdlFRect> rect)>('SDL_RenderFillRect');
  return sdlRenderFillRectLookupFunction(renderer, rect) == 1;
}