SDL_GetWindowDisplayIndex check

This commit is contained in:
Pan7 2015-07-26 13:03:47 +02:00
parent 605dfabb94
commit 9694e93fd2

View file

@ -136,6 +136,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 )