+ char driver[128];
+ SDL_VideoDriverName(driver, sizeof driver);
+ info("SDL video driver: %s", driver);
+
+ const SDL_VideoInfo *vid_inf = SDL_GetVideoInfo();
+ if(gparams->fullscreen) {
+ if(gparams->dont_care_flags & DONT_CARE_SIZE) {
+ int curx = vid_inf->current_w;
+ int cury = vid_inf->current_h;
+ float aspect = (float)curx / cury;
+
+ if(!GOOD_ASPECT(aspect)) {
+ SDL_Rect **modes = SDL_ListModes(0, SDL_OPENGL | SDL_FULLSCREEN);
+ info("Current mode %dx%d sounds like multi-monitor. Available modes:", curx, cury);
+ for(int i=0; modes[i]; i++) {
+ info(" %dx%d", modes[i]->w, modes[i]->h);
+ aspect = (float)modes[i]->w / modes[i]->h;
+ if(GOOD_ASPECT(aspect) && (modes[i]->w == vid_inf->current_w || modes[i]->h == vid_inf->current_h)) {
+ curx = modes[i]->w;
+ cury = modes[i]->h;
+ }
+ }
+ }
+ gparams->x = curx;
+ gparams->y = cury;
+ }
+ } else {