From 8f50cb3a09844b56729847b5c4d641f9446202e1 Mon Sep 17 00:00:00 2001 From: AnotherSeawhite <52661206+AnotherSeawhite@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:26:41 +0900 Subject: [PATCH] Update sdltiles.cpp --- src/sdltiles.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index d99ad5eb431fd..d2f072b524bc3 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -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( "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;