diff options
author | Pan7 <panter@gmx.net> | 2015-07-26 13:03:47 +0200 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2016-04-07 11:02:32 +0100 |
commit | 6a1b563be8d358a7d4af5b43307ace4c5f2c6a99 (patch) | |
tree | c0b3915ce1aeeec8e0262443d647fbe5e2048f4c /src/sdl | |
parent | d3e4081ba8961e9d0eec4927b4a83b084dc02723 (diff) |
SDL_GetWindowDisplayIndex check
Diffstat (limited to 'src/sdl')
-rw-r--r-- | src/sdl/sdl_glimp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c index 9f86dd9e..e979ba1f 100644 --- a/src/sdl/sdl_glimp.c +++ b/src/sdl/sdl_glimp.c @@ -141,6 +141,11 @@ static void GLimp_DetectAvailableModes(void) SDL_DisplayMode windowMode; int display = SDL_GetWindowDisplayIndex( SDL_window ); + if( display < 0 ) + { + ri.Printf( PRINT_WARNING, "Couldn't get window display index, no resolutions detected\n" ); + return; + } numSDLModes = SDL_GetNumDisplayModes( display ); if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 || numSDLModes <= 0 ) |