Skip to content

Commit

Permalink
revert vsync for windows, since glfw does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
cgcostume committed Oct 10, 2014
1 parent 27cb308 commit f1edb41
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions source/examples/common/Context.cpp
Expand Up @@ -242,8 +242,26 @@ void Context::setSwapInterval(const SwapInterval interval)
if (current != m_window)
glfwMakeContextCurrent(m_window);

#ifdef WIN32

using SWAPINTERVALEXTPROC = bool(*)(int);
static SWAPINTERVALEXTPROC wglSwapIntervalEXT(nullptr);

bool result(false);
if (!wglSwapIntervalEXT)
wglSwapIntervalEXT = reinterpret_cast<SWAPINTERVALEXTPROC>(glbinding::getProcAddress("wglSwapIntervalEXT"));
if (wglSwapIntervalEXT)
result = wglSwapIntervalEXT(static_cast<int>(interval));

if(!result)
warning("Setting swap interval to % failed.", swapIntervalString(interval));

#else

glfwSwapInterval(static_cast<int>(interval));

#endif

if (current != m_window)
glfwMakeContextCurrent(current);

Expand Down

0 comments on commit f1edb41

Please sign in to comment.