From 8f1d00292b976a6a3bcfd374f62146d2754d8adb Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 7 May 2015 18:39:51 +0200 Subject: [PATCH] gsdx-ogl: allow to control vsync on Windows Issue #529 Completely untested --- plugins/GSdx/GSWndWGL.cpp | 8 ++------ plugins/GSdx/GSWndWGL.h | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/GSdx/GSWndWGL.cpp b/plugins/GSdx/GSWndWGL.cpp index 69fe40650e..bd788d72c7 100644 --- a/plugins/GSdx/GSWndWGL.cpp +++ b/plugins/GSdx/GSWndWGL.cpp @@ -130,9 +130,7 @@ bool GSWndWGL::Attach(void* handle, bool managed) CheckContext(); - // TODO - //m_swapinterval = (PFNGLXSWAPINTERVALMESAPROC)glXGetProcAddress((const GLubyte*) "glXSwapIntervalMESA"); - //PFNGLXSWAPINTERVALMESAPROC m_swapinterval = (PFNGLXSWAPINTERVALMESAPROC)glXGetProcAddress((const GLubyte*) "glXSwapInterval"); + m_swapinterval = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT"); PopulateGlFunction(); @@ -288,9 +286,7 @@ void GSWndWGL::SetVSync(bool enable) // m_swapinterval uses an integer as parameter // 0 -> disable vsync // n -> wait n frame - //if (m_swapinterval) m_swapinterval((int)enable); - // wglSwapIntervalEXT(!enable); - + if (m_swapinterval) m_swapinterval((int)enable); } void GSWndWGL::Flip() diff --git a/plugins/GSdx/GSWndWGL.h b/plugins/GSdx/GSWndWGL.h index 2802c1993a..3408532995 100644 --- a/plugins/GSdx/GSWndWGL.h +++ b/plugins/GSdx/GSWndWGL.h @@ -29,7 +29,7 @@ class GSWndWGL : public GSWndGL HDC m_NativeDisplay; HGLRC m_context; - //PFNGLXSWAPINTERVALMESAPROC m_swapinterval; + PFNWGLSWAPINTERVALEXTPROC m_swapinterval; bool CreateContext(int major, int minor); void CheckContext();