File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -242,8 +242,26 @@ void Context::setSwapInterval(const SwapInterval interval)
242
242
if (current != m_window)
243
243
glfwMakeContextCurrent (m_window);
244
244
245
+ #ifdef WIN32
246
+
247
+ using SWAPINTERVALEXTPROC = bool (*)(int );
248
+ static SWAPINTERVALEXTPROC wglSwapIntervalEXT (nullptr );
249
+
250
+ bool result (false );
251
+ if (!wglSwapIntervalEXT)
252
+ wglSwapIntervalEXT = reinterpret_cast <SWAPINTERVALEXTPROC>(glbinding::getProcAddress (" wglSwapIntervalEXT" ));
253
+ if (wglSwapIntervalEXT)
254
+ result = wglSwapIntervalEXT (static_cast <int >(interval));
255
+
256
+ if (!result)
257
+ warning (" Setting swap interval to % failed." , swapIntervalString (interval));
258
+
259
+ #else
260
+
245
261
glfwSwapInterval (static_cast <int >(interval));
246
262
263
+ #endif
264
+
247
265
if (current != m_window)
248
266
glfwMakeContextCurrent (current);
249
267
You can’t perform that action at this time.
0 commit comments