diff options
author | David Robillard <d@drobilla.net> | 2019-06-27 23:09:15 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-06-27 23:22:11 +0200 |
commit | aa9eafb77d8122553d3090107a7f9c732817f64a (patch) | |
tree | 113efb01ca46226c2e924b403f81e3cf3ddef464 /pugl/pugl_win.cpp | |
parent | c91eb8ee3e5b1ea6817ce7c2dcc94aaf1e7fdd2c (diff) | |
download | pugl-aa9eafb77d8122553d3090107a7f9c732817f64a.tar.gz pugl-aa9eafb77d8122553d3090107a7f9c732817f64a.tar.bz2 pugl-aa9eafb77d8122553d3090107a7f9c732817f64a.zip |
Enable vsync on Windows
Diffstat (limited to 'pugl/pugl_win.cpp')
-rw-r--r-- | pugl/pugl_win.cpp | 9 |
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; } |