Added SDL_GetRenderLogicalPresentationRect()

Fixes https://github.com/libsdl-org/SDL/issues/8815
This commit is contained in:
Sam Lantinga
2024-06-29 14:12:50 -07:00
parent b72c22340e
commit 473257cce6
6 changed files with 107 additions and 0 deletions

View File

@@ -1297,6 +1297,7 @@ extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_GetRenderTarget(SDL_Renderer *rende
*
* \sa SDL_ConvertEventToRenderCoordinates
* \sa SDL_GetRenderLogicalPresentation
* \sa SDL_GetRenderLogicalPresentationRect
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode);
@@ -1320,6 +1321,22 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *r
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode);
/**
* Get the final presentation rectangle for rendering.
*
* This function returns the calculated rectangle used for logical presentation, based on the presentation mode and output size. If logical presentation is disabled, it will fill the rectangle with the output size, in pixels.
*
* \param renderer the rendering context.
* \param rect a pointer filled in with the final presentation rectangle, may be NULL.
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetRenderLogicalPresentation
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect);
/**
* Get a point in render coordinates when given a point in window coordinates.
*