mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 06:31:47 +00:00
SDL_GetWindowDisplayIndex() check2
This commit is contained in:
parent
605dfabb94
commit
56808ab51f
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue