SDL Wiki
[ front page | index | search | recent changes | git repo | offline html ]

SDL_SetRenderLogicalPresentationRect

Set the final presentation rectangle for rendering.

Header File

Defined in <SDL3/SDL_render.h>

Syntax

bool SDL_SetRenderLogicalPresentationRect(SDL_Renderer *renderer, const SDL_FRect *rect);

Function Parameters

SDL_Renderer * renderer the rendering context.
const SDL_FRect * rect the presentation rectangle, in pixels, or NULL to stretch to the full output size.

Return Value

(bool) Returns true on success or false on failure; call SDL_GetError() for more information.

Remarks

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.

Thread Safety

This function should only be called on the main thread.

Version

This function is available since SDL 3.6.0.

See Also


CategoryAPI, CategoryAPIFunction, CategoryRender


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.