Skip to content

Commit

Permalink
Reenabled vsync and some other OpenGL attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Grumbel committed Jul 31, 2014
1 parent 66d9193 commit 0f1c509
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/video/gl/gl_renderer.cpp
Expand Up @@ -60,21 +60,23 @@ GLRenderer::GLRenderer() :
if(texture_manager != 0)
texture_manager->save_textures();

#ifdef SDL_GL_SWAP_CONTROL
if(config->try_vsync) {
if(g_config->try_vsync) {
/* we want vsync for smooth scrolling */
SDL_GL_SetSwapInterval(1);
if (SDL_GL_SetSwapInterval(-1) != 0)
{
log_info << "no support for late swap tearing vsync: " << SDL_GetError() << std::endl;
if (SDL_GL_SetSwapInterval(1))
{
log_info << "no support for vsync: " << SDL_GetError() << std::endl;
}
}
}
#endif

#ifdef OLD_SDL1
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);

// FIXME: Hu? 16bit rendering?
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
#endif
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);

if(g_config->use_fullscreen)
{
Expand Down

0 comments on commit 0f1c509

Please sign in to comment.