SDL_GetWindowDisplayIndex() check2

This commit is contained in:
Pan7 2015-07-26 19:46:07 +02:00
parent 605dfabb94
commit 56808ab51f

View file

@ -245,9 +245,15 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
// 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 )
{
displayAspect = (float)desktopMode.w / (float)desktopMode.h;