mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-27 14:32:55 +00:00
Merge pull request #137 from Pan7/SDL_display
SDL_GetWindowDisplayIndex() check2
This commit is contained in:
commit
793708a010
1 changed files with 7 additions and 1 deletions
|
@ -250,9 +250,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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue