sdlxSetRenderLogicalPresentationRect function render

bool sdlxSetRenderLogicalPresentationRect(
  1. Pointer<SdlRenderer> renderer,
  2. SdlxFRect rect
)

Set the final presentation rectangle for rendering.

This function sets the rectangle used when the logical presentation mode is SDL_LOGICAL_PRESENTATION_CUSTOM.

The logical size is scaled to fit the rectangle, so if the rectangle has a different aspect ratio than the logical size, the output will be stretched. The rectangle is in pixels and may extend past the edges of the output.

Each render target has its own logical presentation state. This function sets the rectangle for the current render target.

\param renderer the rendering context. \param rect the presentation rectangle, in pixels, or NULL to stretch to the full output size. \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.6.0.

\sa SDL_GetRenderLogicalPresentationRect \sa SDL_SetRenderLogicalPresentation

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

See also:

Implementation

bool sdlxSetRenderLogicalPresentationRect(
  Pointer<SdlRenderer> renderer,
  SdlxFRect rect,
) => ffi.using((arena) {
  final rectPointer = rect.toNative(arena);
  final result = sdlSetRenderLogicalPresentationRect(renderer, rectPointer);
  return result;
});