Skip to content

Commit

Permalink
Merge pull request #1221 from chocolate-doom/render_retry
Browse files Browse the repository at this point in the history
video: if renderer creation failed, try again without acceleration
  • Loading branch information
chungy committed Dec 6, 2019
2 parents f0e330b + fe9a6a8 commit d346646
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/i_video.c
Expand Up @@ -1246,6 +1246,23 @@ static void SetVideoMode(void)

renderer = SDL_CreateRenderer(screen, -1, renderer_flags);

// If we could not find a matching render driver,
// try again without hardware acceleration.

if (renderer == NULL && !force_software_renderer)
{
renderer_flags |= SDL_RENDERER_SOFTWARE;
renderer_flags &= ~SDL_RENDERER_PRESENTVSYNC;

renderer = SDL_CreateRenderer(screen, -1, renderer_flags);

// If this helped, save the setting for later.
if (renderer != NULL)
{
force_software_renderer = 1;
}
}

if (renderer == NULL)
{
I_Error("Error creating renderer for screen window: %s",
Expand Down

0 comments on commit d346646

Please sign in to comment.