How to enable VSYNC in OpenGL

The WGL_EXT_swap_control extension allows you to do this on Windows, but I cannot find anything, even remotely cross-platform, doing the same thing, that is, synchronize my buffer swaps with a screen update. My application uses GLEW, so something suggested by this would be preferable. Cross-platform support for Linux, Mac and Windows is necessary, but my application will not break if synchronization cannot be established (for example, a user has disabled it in their graphics drivers).

I will take program code to do this on many platforms, with GLEW, as a valid answer.

+3
source share
4 answers

, , Mac OS X, , , .

0

- . ( ). API ( ). - . glew , .

, API , , - .

, . , (, Aero , ), .

, API :

  • wglSwapIntervalEXT
  • glXSwapIntervalSGI
  • AGLSetInteger
+6

http://www.opengl.org/wiki/Swap_Interval ( http://www.opengl.org/registry/specs/SGI/swap_control.txt):

Linux . GLX_SGI_swap_control , glGetString(GL_EXTENSIONS), glXSwapIntervalSGI(0) vsync glXSwapIntervalSGI(1), vsync ( ).

+1
0

Source: https://habr.com/ru/post/1728873/


All Articles