diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sdl/sdl_glimp.c | 8 |
1 files changed, 7 insertions, 1 deletions
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; |