Added VSync setting and corrected default framebuffer MSAA setting

master
Tomasz Kapuściński 2016-03-29 13:38:53 +02:00
parent 11508b2caa
commit 32d1994c98
1 changed files with 14 additions and 3 deletions

View File

@ -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;
}