summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-08 18:14:51 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-08 18:14:51 +0200
commita31b3f27037cc75b733a34871cfadc9707055b16 (patch)
tree8b7f9461925b20aea5453591ffce61570783cd84 /src/ui/window.c
parentc3bbfbba4209a2d11b65b58233619b05e4397c91 (diff)
Scale images for display
Resize images down to the maximum texture size or the screen size, whichever is smaller. IssueID #167
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 038d72af..3c362986 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -1397,11 +1397,18 @@ SDL_Renderer *renderer_Window(const iWindow *d) {
1397 return d->render; 1397 return d->render;
1398} 1398}
1399 1399
1400iInt2 maxTextureSize_Window(const iWindow *d) {
1401 SDL_RendererInfo info;
1402 SDL_GetRendererInfo(d->render, &info);
1403 return init_I2(info.max_texture_width, info.max_texture_height);
1404}
1405
1400iBool isFullscreen_Window(const iWindow *d) { 1406iBool isFullscreen_Window(const iWindow *d) {
1401 return snap_Window(d) == fullscreen_WindowSnap; 1407 return snap_Window(d) == fullscreen_WindowSnap;
1402} 1408}
1403 1409
1404static void invalidate_Window_(iWindow *d) { 1410static void invalidate_Window_(iWindow *d) {
1411 iUnused(d);
1405 resetFonts_Text(); 1412 resetFonts_Text();
1406 postCommand_App("theme.changed"); /* forces UI invalidation */ 1413 postCommand_App("theme.changed"); /* forces UI invalidation */
1407} 1414}