From 32d1994c98573835c915681f44c6b8b69b39347d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Tue, 29 Mar 2016 13:38:53 +0200 Subject: [PATCH] Added VSync setting and corrected default framebuffer MSAA setting --- src/app/app.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/app/app.cpp b/src/app/app.cpp index 5e91af9a..5547c453 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -791,10 +791,13 @@ bool CApplication::CreateVideoSurface() int msaa = 0; if (GetConfigFile().GetIntProperty("Experimental", "MSAA", msaa)) { - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, msaa); + if (msaa > 1) + { + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, msaa); - GetLogger()->Info("Using MSAA on default framebuffer (%d samples)\n", msaa); + GetLogger()->Info("Using MSAA on default framebuffer (%d samples)\n", msaa); + } } /* If hardware acceleration specifically requested, this will force the hw accel @@ -809,6 +812,14 @@ bool CApplication::CreateVideoSurface() m_private->glcontext = SDL_GL_CreateContext(m_private->window); + int vsync = 0; + if (GetConfigFile().GetIntProperty("Experimental", "VSync", vsync)) + { + SDL_GL_SetSwapInterval(vsync); + + GetLogger()->Info("Using Vsync: %s\n", (vsync ? "true" : "false")); + } + return true; }