aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-06-27 23:09:15 +0200
committerDavid Robillard <d@drobilla.net>2019-06-27 23:22:11 +0200
commitaa9eafb77d8122553d3090107a7f9c732817f64a (patch)
tree113efb01ca46226c2e924b403f81e3cf3ddef464
parentc91eb8ee3e5b1ea6817ce7c2dcc94aaf1e7fdd2c (diff)
Enable vsync on Windows
-rw-r--r--pugl/pugl_win.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp
index 4a1d008..9bc9438 100644
--- a/pugl/pugl_win.cpp
+++ b/pugl/pugl_win.cpp
@@ -186,8 +186,17 @@ puglCreateWindow(PuglView* view, const char* title)
free(view);
return NULL;
}
+
wglMakeCurrent(impl->hdc, impl->hglrc);
+ typedef BOOL (*SwapIntervalFunc)(int);
+
+ SwapIntervalFunc swapInterval = (SwapIntervalFunc)wglGetProcAddress(
+ "wglSwapIntervalEXT");
+ if (swapInterval) {
+ swapInterval(1);
+ }
+
return 0;
}