Skip to content

Commit

Permalink
sdltiles
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherSeawhite authored Apr 2, 2024
1 parent fb12ad8 commit 2080a20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,12 @@ static void WinCreate()
if( !software_renderer ) {
dbg( D_INFO ) << "Attempting to initialize accelerated SDL renderer.";

renderer.reset( SDL_CreateRenderer( ::window.get(), renderer_id, SDL_RENDERER_ACCELERATED |
SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE ) );
int init_flags = SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE;
if( get_option<bool>( "VSYNC" ) ) {
init_flags |= SDL_RENDERER_PRESENTVSYNC;
}

renderer.reset( SDL_CreateRenderer( ::window.get(), renderer_id, init_flags ) );
if( printErrorIf( !renderer,
"Failed to initialize accelerated renderer, falling back to software rendering" ) ) {
software_renderer = true;
Expand Down

0 comments on commit 2080a20

Please sign in to comment.