-#else
-
-#if defined(TARGET_SDL2)
- sdl_window = SDL_CreateWindow(program.window_title,
- SDL_WINDOWPOS_CENTERED,
- SDL_WINDOWPOS_CENTERED,
- fullscreen_width, fullscreen_height,
- surface_flags_fullscreen);
- if (sdl_window != NULL)
- {
- new_surface = SDL_GetWindowSurface(sdl_window);
-
- // SDL_UpdateWindowSurface(sdl_window); // immediately map window
- // UpdateScreen(NULL); // immediately map window
- }
-#else
- new_surface = SDL_SetVideoMode(fullscreen_width, fullscreen_height,
- video.depth, surface_flags_fullscreen);
-#endif
-#endif
-
- if (new_surface == NULL)
- {
- /* switching display to fullscreen mode failed */
- Error(ERR_WARN, "SDL_SetVideoMode() failed: %s", SDL_GetError());
-
- /* do not try it again */
- video.fullscreen_available = FALSE;
-
- success = FALSE;
- }
- else
- {
- (*backbuffer)->surface = new_surface;
-
- video.fullscreen_enabled = TRUE;
- video.fullscreen_mode_current = setup.fullscreen_mode;
-
- success = TRUE;
- }
- }
-
- if ((!fullscreen && video.fullscreen_enabled) || new_surface == NULL)
- {
- video_xoffset = 0;
- video_yoffset = 0;
-
- /* switch display to window mode */
-#if 1
- new_surface = SDLCreateScreen(backbuffer, FALSE);
-#else
-
-#if defined(TARGET_SDL2)
-
-#if USE_RENDERER
- float screen_scaling_factor = 1.2;
- int test_fullscreen = 0;
- int surface_flags = (test_fullscreen ? surface_flags_fullscreen :
- surface_flags_window);
-
- if ((*backbuffer)->surface)
- SDL_FreeSurface((*backbuffer)->surface);
-
- if (sdl_texture)
- SDL_DestroyTexture(sdl_texture);
-
- if (sdl_renderer)
- SDL_DestroyRenderer(sdl_renderer);
-
- if (sdl_window)
- SDL_DestroyWindow(sdl_window);
-
- sdl_window = SDL_CreateWindow(program.window_title,
- SDL_WINDOWPOS_CENTERED,
- SDL_WINDOWPOS_CENTERED,
- (int)(screen_scaling_factor * video.width),
- (int)(screen_scaling_factor * video.height),
- surface_flags);
-
- if (sdl_window != NULL)
- {
- sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0);
-
- if (sdl_renderer != NULL)
- {
- SDL_RenderSetLogicalSize(sdl_renderer, video.width, video.height);
- SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
-
- sdl_texture = SDL_CreateTexture(sdl_renderer,
- SDL_PIXELFORMAT_ARGB8888,
- SDL_TEXTUREACCESS_STREAMING,
- video.width, video.height);