Commit 81072d68 authored by Laurent Aimar's avatar Laurent Aimar
Browse files

Used WGL_EXT_swap_control in glwin32.

It avoid tearing depending on the default settings.
parent 8e18506a
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#endif #endif
#include "../opengl.h" #include "../opengl.h"
#include <GL/wglew.h>
#include "common.h" #include "common.h"
/***************************************************************************** /*****************************************************************************
...@@ -108,6 +109,15 @@ static int Open(vlc_object_t *object) ...@@ -108,6 +109,15 @@ static int Open(vlc_object_t *object)
sys->hGLRC = wglCreateContext(sys->hGLDC); sys->hGLRC = wglCreateContext(sys->hGLDC);
wglMakeCurrent(sys->hGLDC, sys->hGLRC); wglMakeCurrent(sys->hGLDC, sys->hGLRC);
const char *extensions = (const char*)glGetString(GL_EXTENSIONS);
#ifdef WGL_EXT_swap_control
if (HasExtension(extensions, "WGL_EXT_swap_control")) {
PFNWGLSWAPINTERVALEXTPROC SwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
if (SwapIntervalEXT)
SwapIntervalEXT(1);
}
#endif
/* */ /* */
sys->gl.lock = NULL; sys->gl.lock = NULL;
sys->gl.unlock = NULL; sys->gl.unlock = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment