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 6471 5f6990aaf357
parent 6470 ca793191b67a
child 6472 d4623b7209db
Print a message if the window size was changed from the requested size.
test/common.c
--- a/test/common.c	Thu Sep 27 11:16:31 2012 -0700
+++ b/test/common.c	Thu Sep 27 11:13:30 2012 -0700
@@ -561,7 +561,7 @@
 SDL_bool
 CommonInit(CommonState * state)
 {
-    int i, j, m, n;
+    int i, j, m, n, w, h;
     SDL_DisplayMode fullscreen_mode;
 
     if (state->flags & SDL_INIT_VIDEO) {
@@ -735,8 +735,12 @@
                         SDL_GetError());
                 return SDL_FALSE;
             }
-            SDL_GetWindowSize(state->windows[i], &state->window_w, &state->window_h);
-
+            SDL_GetWindowSize(state->windows[i], &w, &h);
+            if (w != state->window_w || h != state->window_h) {
+                printf("Window requested size %dx%d, got %dx%d\n", state->window_w, state->window_h, w, h);
+                state->window_w = w;
+                state->window_h = h;
+            }
             if (SDL_SetWindowDisplayMode(state->windows[i], &fullscreen_mode) < 0) {
                 fprintf(stderr, "Can't set up fullscreen display mode: %s\n",
                         SDL_GetError());