MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / setVSync

Method setVSync

src/Engine/OpenGL.cpp:311–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309 }
310
311 void OpenGL::setVSync(bool sync)
312 {
313 const int interval = sync ? 1 : 0;
314 if (glXGetCurrentDisplay && glXGetCurrentDrawable && glXSwapIntervalEXT)
315 {
316 void *dpy = glXGetCurrentDisplay();
317 Uint32 drawable = glXGetCurrentDrawable();
318
319 if (drawable) {
320 glXSwapIntervalEXT(dpy, drawable, interval);
321 // Log(LOG_INFO) << "Made an attempt to set vsync via GLX.";
322 }
323 } else if (wglSwapIntervalEXT)
324 {
325 wglSwapIntervalEXT(interval);
326 // Log(LOG_INFO) << "Made an attempt to set vsync via WGL.";
327 }
328 }
329
330 void OpenGL::term() {
331 if(gltexture) {

Callers 1

resetDisplayMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected