Print a message if the window size was changed from the requested size.
authorSam Lantinga <slouken@libsdl.org>
Thu, 27 Sep 2012 11:13:30 -0700
changeset 64715f6990aaf357
parent 6470 ca793191b67a
child 6472 d4623b7209db
Print a message if the window size was changed from the requested size.
test/common.c
     1.1 --- a/test/common.c	Thu Sep 27 11:16:31 2012 -0700
     1.2 +++ b/test/common.c	Thu Sep 27 11:13:30 2012 -0700
     1.3 @@ -561,7 +561,7 @@
     1.4  SDL_bool
     1.5  CommonInit(CommonState * state)
     1.6  {
     1.7 -    int i, j, m, n;
     1.8 +    int i, j, m, n, w, h;
     1.9      SDL_DisplayMode fullscreen_mode;
    1.10  
    1.11      if (state->flags & SDL_INIT_VIDEO) {
    1.12 @@ -735,8 +735,12 @@
    1.13                          SDL_GetError());
    1.14                  return SDL_FALSE;
    1.15              }
    1.16 -            SDL_GetWindowSize(state->windows[i], &state->window_w, &state->window_h);
    1.17 -
    1.18 +            SDL_GetWindowSize(state->windows[i], &w, &h);
    1.19 +            if (w != state->window_w || h != state->window_h) {
    1.20 +                printf("Window requested size %dx%d, got %dx%d\n", state->window_w, state->window_h, w, h);
    1.21 +                state->window_w = w;
    1.22 +                state->window_h = h;
    1.23 +            }
    1.24              if (SDL_SetWindowDisplayMode(state->windows[i], &fullscreen_mode) < 0) {
    1.25                  fprintf(stderr, "Can't set up fullscreen display mode: %s\n",
    1.26                          SDL_GetError());