Skip to content

Commit

Permalink
Don't show display name if there is none
Browse files Browse the repository at this point in the history
In Windows 10 display 1 returns a display name of "0".
  • Loading branch information
bradharding committed Aug 1, 2015
1 parent 666f760 commit d82754e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/i_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,15 @@ static void SetVideoMode(dboolean output)
displayindex = vid_display_default - 1;
}
if (output)
C_Output("Using display %i of %i called \"%s\".",
displayindex + 1, numdisplays, SDL_GetDisplayName(displayindex));
{
const char *displayname = SDL_GetDisplayName(displayindex);

if (strlen(displayname) > 1)
C_Output("Using display %i of %i called \"%s\".", displayindex + 1, numdisplays,
displayname);
else
C_Output("Using display %i of %i.", displayindex + 1, numdisplays);
}

if (vid_vsync)
flags |= SDL_RENDERER_PRESENTVSYNC;
Expand Down

0 comments on commit d82754e

Please sign in to comment.