From 22b5d7b96190ada24158a9ba41fee893f1a5cb46 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Sun, 26 Jul 2015 19:46:07 +0200 Subject: SDL_GetWindowDisplayIndex() check2 --- src/sdl/sdl_glimp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/sdl') diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c index e4c816c0..efe712fd 100644 --- a/src/sdl/sdl_glimp.c +++ b/src/sdl/sdl_glimp.c @@ -258,9 +258,15 @@ static int GLimp_SetMode( qboolean failSafe, qboolean fullscreen, qboolean nobor // If a window exists, note its display index if( SDL_window != NULL ) + { display = SDL_GetWindowDisplayIndex( SDL_window ); + if( display < 0 ) + { + ri.Printf( PRINT_DEVELOPER, "SDL_GetWindowDisplayIndex() failed: %s\n", SDL_GetError() ); + } + } - if( SDL_GetDesktopDisplayMode( display, &desktopMode ) == 0 ) + if( display >= 0 && SDL_GetDesktopDisplayMode( display, &desktopMode ) == 0 ) { glConfig.displayAspect = (float)desktopMode.w / (float)desktopMode.h; -- cgit