- static int desktop_width = 0;
- static int desktop_height = 0;
-
-/* unfortunately only newer SDLs have these infos */
-#if SDL_MAJOR_VERSION > 1 || SDL_MINOR_VERSION > 2 || (SDL_MINOR_VERSION == 2 && SDL_PATCHLEVEL >= 10)
- /* find which resolution the user normally uses */
- if(desktop_width == 0) {
- const SDL_VideoInfo *info = SDL_GetVideoInfo();
- desktop_width = info->current_w;
- desktop_height = info->current_h;
- }
-#endif
-
- double aspect_ratio = static_cast<double>(config->aspect_width) /
- static_cast<double>(config->aspect_height);
-
- // use aspect ratio to calculate logical resolution
- if (aspect_ratio > 1) {
- SCREEN_WIDTH = static_cast<int> (600 * aspect_ratio + 0.5);
- SCREEN_HEIGHT = 600;
- } else {
- SCREEN_WIDTH = 600;
- SCREEN_HEIGHT = static_cast<int> (600 * 1/aspect_ratio + 0.5);
- }