@@ -82,9 +82,12 @@ void SetVideoMode(int width, int height, int bpp, uint32_t flags)
8282 sdl_error (ERR_SDL_DISPLAY_MODE_SET);
8383 }
8484#if DEBUG_MODE
85- const SDL_VideoInfo* current = SDL_GetVideoInfo ();
86- DoLog (" Video mode is now %dx%d bpp=%d flags=0x%08X" ,
87- current->current_w , current->current_h , current->vfmt ->BitsPerPixel , SDL_GetVideoSurface ()->flags );
85+ const SDL_Surface *surface = SDL_GetVideoSurface ();
86+ if (surface == NULL ) {
87+ sdl_error (ERR_SDL_DISPLAY_MODE_SET);
88+ }
89+ DoLog (" Video surface is now %dx%d bpp=%d flags=0x%08X" ,
90+ surface->w , surface->h , surface->format ->BitsPerPixel , surface->flags );
8891#endif
8992}
9093
@@ -266,9 +269,12 @@ void SpawnWindow()
266269 if (grabInput)
267270 SDL_WM_GrabInput (SDL_GRAB_ON);
268271 atexit (SDL_VideoQuit); // Without this video mode is not restored after fullscreen.
269- const SDL_VideoInfo* current = SDL_GetVideoInfo ();
270- width = current->current_w ;
271- height = current->current_h ;
272+ const SDL_Surface *surface = SDL_GetVideoSurface ();
273+ if (surface == NULL ) {
274+ sdl_error (ERR_SDL_WINDOW_CREATE);
275+ }
276+ width = surface->w ;
277+ height = surface->h ;
272278#else
273279 bool integerScalingEnabled = getIniBool (" Graphics" , " Integer Scaling" , false );
274280 bool upscale = getIniBool (" Graphics" , " Upscale" , true );
0 commit comments