test/testdisplayinfo.c
changeset 10038 2bab6f8d403e
parent 9998 f67cf37e9cd4
child 10737 3406a0f8b041
     1.1 --- a/test/testdisplayinfo.c	Wed Jan 06 22:39:29 2016 +0100
     1.2 +++ b/test/testdisplayinfo.c	Thu Jan 07 14:02:37 2016 -0500
     1.3 @@ -51,11 +51,18 @@
     1.4      for (dpy = 0; dpy < num_displays; dpy++) {
     1.5          const int num_modes = SDL_GetNumDisplayModes(dpy);
     1.6          SDL_Rect rect = { 0, 0, 0, 0 };
     1.7 +        float ddpi, hdpi, vdpi;
     1.8          int m;
     1.9  
    1.10          SDL_GetDisplayBounds(dpy, &rect);
    1.11          SDL_Log("%d: \"%s\" (%dx%d, (%d, %d)), %d modes.\n", dpy, SDL_GetDisplayName(dpy), rect.w, rect.h, rect.x, rect.y, num_modes);
    1.12  
    1.13 +        if (SDL_GetDisplayDPI(dpy, &ddpi, &hdpi, &vdpi) == -1) {
    1.14 +            SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "    DPI: failed to query (%s)\n", SDL_GetError());
    1.15 +        } else {
    1.16 +            SDL_Log("    DPI: ddpi=%f; hdpi=%f; vdpi=%f\n", ddpi, hdpi, vdpi);
    1.17 +        }
    1.18 +
    1.19          if (SDL_GetCurrentDisplayMode(dpy, &mode) == -1) {
    1.20              SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "    CURRENT: failed to query (%s)\n", SDL_GetError());
    1.21          } else {