foxygit / doom Log in
commit 1aa66bd35de5843416c0de6a1c5d1a0ff0cb6fc2
Author:     linguica <github@andrewstine.org>
AuthorDate: Mon Feb 20 14:12:52 2017 -0800
Commit:     GitHub <noreply@github.com>
CommitDate: Mon Feb 20 14:12:52 2017 -0800

    Add flag to activate vsync.

    The current SDL2 build demonstrates screen tearing, which wasn't present on the original DOS version. Turning on vsync eliminates this.
---
 src/i_video.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/i_video.c b/src/i_video.c
index 78bdd751..4ca10643 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1199,6 +1199,9 @@ static void SetVideoMode(void)
     // The SDL_RENDERER_TARGETTEXTURE flag is required to render the
     // intermediate texture into the upscaled texture.
     renderer_flags = SDL_RENDERER_TARGETTEXTURE;
+
+    // Turn on vsync
+    renderer_flags |= SDL_RENDERER_PRESENTVSYNC;

     if (force_software_renderer)
     {