summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPan7 <panter@gmx.net>2015-07-26 19:46:07 +0200
committerTim Angus <tim@ngus.net>2016-04-07 11:02:32 +0100
commit22b5d7b96190ada24158a9ba41fee893f1a5cb46 (patch)
tree0d44604303db5de6ac57c94d214507a883308dad
parent12c86c4d96fb34625ac439458055a919956e3f7c (diff)
SDL_GetWindowDisplayIndex() check2
-rw-r--r--src/sdl/sdl_glimp.c8
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;