test: info now reports usable display bounds and DPI (thanks, Eric!).
authorRyan C. Gordon <icculus@icculus.org>
Thu, 18 May 2017 16:29:10 -0400
changeset 11012c2f18f1f7e97
parent 11011 d3ac11b79213
child 11013 06a6583f0fda
test: info now reports usable display bounds and DPI (thanks, Eric!).

Fixes Bugzilla #3652.
src/test/SDL_test_common.c
     1.1 --- a/src/test/SDL_test_common.c	Thu May 18 16:27:36 2017 -0400
     1.2 +++ b/src/test/SDL_test_common.c	Thu May 18 16:29:10 2017 -0400
     1.3 @@ -706,7 +706,9 @@
     1.4          }
     1.5  
     1.6          if (state->verbose & VERBOSE_MODES) {
     1.7 -            SDL_Rect bounds;
     1.8 +            SDL_Rect bounds, usablebounds;
     1.9 +            float hdpi = 0;
    1.10 +            float vdpi = 0;
    1.11              SDL_DisplayMode mode;
    1.12              int bpp;
    1.13              Uint32 Rmask, Gmask, Bmask, Amask;
    1.14 @@ -721,7 +723,15 @@
    1.15  
    1.16                  SDL_zero(bounds);
    1.17                  SDL_GetDisplayBounds(i, &bounds);
    1.18 +
    1.19 +                SDL_zero(usablebounds);
    1.20 +                SDL_GetDisplayUsableBounds(i, &usablebounds);
    1.21 +
    1.22 +                SDL_GetDisplayDPI(i, NULL, &hdpi, &vdpi);
    1.23 +
    1.24                  SDL_Log("Bounds: %dx%d at %d,%d\n", bounds.w, bounds.h, bounds.x, bounds.y);
    1.25 +                SDL_Log("Usable bounds: %dx%d at %d,%d\n", usablebounds.w, usablebounds.h, usablebounds.x, usablebounds.y);
    1.26 +                SDL_Log("DPI: %fx%f\n", hdpi, vdpi);
    1.27  
    1.28                  SDL_GetDesktopDisplayMode(i, &mode);
    1.29                  SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, &Gmask,