test/common.c
changeset 6471 5f6990aaf357
parent 6422 fd0ac1b56115
child 6503 8ff31baded38
equal deleted inserted replaced
6470:ca793191b67a 6471:5f6990aaf357
   559 }
   559 }
   560 
   560 
   561 SDL_bool
   561 SDL_bool
   562 CommonInit(CommonState * state)
   562 CommonInit(CommonState * state)
   563 {
   563 {
   564     int i, j, m, n;
   564     int i, j, m, n, w, h;
   565     SDL_DisplayMode fullscreen_mode;
   565     SDL_DisplayMode fullscreen_mode;
   566 
   566 
   567     if (state->flags & SDL_INIT_VIDEO) {
   567     if (state->flags & SDL_INIT_VIDEO) {
   568         if (state->verbose & VERBOSE_VIDEO) {
   568         if (state->verbose & VERBOSE_VIDEO) {
   569             n = SDL_GetNumVideoDrivers();
   569             n = SDL_GetNumVideoDrivers();
   733             if (!state->windows[i]) {
   733             if (!state->windows[i]) {
   734                 fprintf(stderr, "Couldn't create window: %s\n",
   734                 fprintf(stderr, "Couldn't create window: %s\n",
   735                         SDL_GetError());
   735                         SDL_GetError());
   736                 return SDL_FALSE;
   736                 return SDL_FALSE;
   737             }
   737             }
   738             SDL_GetWindowSize(state->windows[i], &state->window_w, &state->window_h);
   738             SDL_GetWindowSize(state->windows[i], &w, &h);
   739 
   739             if (w != state->window_w || h != state->window_h) {
       
   740                 printf("Window requested size %dx%d, got %dx%d\n", state->window_w, state->window_h, w, h);
       
   741                 state->window_w = w;
       
   742                 state->window_h = h;
       
   743             }
   740             if (SDL_SetWindowDisplayMode(state->windows[i], &fullscreen_mode) < 0) {
   744             if (SDL_SetWindowDisplayMode(state->windows[i], &fullscreen_mode) < 0) {
   741                 fprintf(stderr, "Can't set up fullscreen display mode: %s\n",
   745                 fprintf(stderr, "Can't set up fullscreen display mode: %s\n",
   742                         SDL_GetError());
   746                         SDL_GetError());
   743                 return SDL_FALSE;
   747                 return SDL_FALSE;
   744             }
   748             }