From aa9eafb77d8122553d3090107a7f9c732817f64a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 27 Jun 2019 23:09:15 +0200 Subject: Enable vsync on Windows --- pugl/pugl_win.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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; } -- cgit v1.2.1