mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Simplify RenderGetViewportSize
This commit is contained in:
parent
2af765da11
commit
3edf337d66
@ -2156,14 +2156,11 @@ SDL_RenderGetViewport(SDL_Renderer * renderer, SDL_Rect * rect)
|
|||||||
static void
|
static void
|
||||||
RenderGetViewportSize(SDL_Renderer * renderer, SDL_FRect * rect)
|
RenderGetViewportSize(SDL_Renderer * renderer, SDL_FRect * rect)
|
||||||
{
|
{
|
||||||
CHECK_RENDERER_MAGIC(renderer, );
|
|
||||||
if (rect) {
|
|
||||||
rect->x = 0.0f;
|
rect->x = 0.0f;
|
||||||
rect->y = 0.0f;
|
rect->y = 0.0f;
|
||||||
rect->w = renderer->viewport.w / renderer->scale.x;
|
rect->w = renderer->viewport.w / renderer->scale.x;
|
||||||
rect->h = renderer->viewport.h / renderer->scale.y;
|
rect->h = renderer->viewport.h / renderer->scale.y;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_RenderSetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
|
SDL_RenderSetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
|
||||||
|
Loading…
Reference in New Issue
Block a user