Skip to content

Commit

Permalink
Merge pull request #5 from AnotherSeawhite/revert-4-vsync-fix-pr
Browse files Browse the repository at this point in the history
Revert "vsync option"
  • Loading branch information
AnotherSeawhite authored Apr 2, 2024
2 parents d5d7b57 + 98b8a4e commit 3506565
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
7 changes: 0 additions & 7 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2648,13 +2648,6 @@ void options_manager::add_options_graphics()
false, COPT_CURSES_HIDE
);

#if defined(SDL_HINT_RENDER_VSYNC)
add( "VSYNC", graphics, translate_marker( "Use VSync" ),
translate_marker( "Enable vertical synchronization to prevent screen tearing. VSync can slow the game down a lot. Requires restart." ),
false, COPT_CURSES_HIDE
);
#endif

#if defined(__ANDROID__)
get_option( "FRAMEBUFFER_ACCEL" ).setPrerequisite( "SOFTWARE_RENDERING" );
#else
Expand Down
8 changes: 2 additions & 6 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,8 @@ static void WinCreate()
if( !software_renderer ) {
dbg( D_INFO ) << "Attempting to initialize accelerated SDL renderer.";

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 ) );
renderer.reset( SDL_CreateRenderer( ::window.get(), renderer_id, SDL_RENDERER_ACCELERATED |
SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE ) );
if( printErrorIf( !renderer,
"Failed to initialize accelerated renderer, falling back to software rendering" ) ) {
software_renderer = true;
Expand Down

0 comments on commit 3506565

Please sign in to comment.