Skip to content

Commit

Permalink
Merge pull request #135 from Pan7/SDL_Index
Browse files Browse the repository at this point in the history
SDL_GetWindowDisplayIndex check
  • Loading branch information
timangus committed Jul 26, 2015
2 parents 19fe4f8 + 4b17629 commit 5a495d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code/sdl/sdl_glimp.c
Expand Up @@ -136,11 +136,16 @@ 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: %s\n", SDL_GetError() );
return;
}
numSDLModes = SDL_GetNumDisplayModes( display );

if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 || numSDLModes <= 0 )
{
ri.Printf( PRINT_WARNING, "Couldn't get window display mode, no resolutions detected\n" );
ri.Printf( PRINT_WARNING, "Couldn't get window display mode, no resolutions detected: %s\n", SDL_GetError() );
return;
}

Expand Down

0 comments on commit 5a495d5

Please sign in to comment.