Recent

Author Topic: VSync on other platforms than Windows  (Read 4906 times)

Pascal

  • Hero Member
  • *****
  • Posts: 932
VSync on other platforms than Windows
« on: July 12, 2017, 11:51:22 pm »
How can i do swap buffers syncronized to VSync on Linux or MacOS.

If there is a way to do so, i could add it to TCustomOpenGLControl.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: VSync on other platforms than Windows
« Reply #1 on: July 13, 2017, 06:41:54 am »
Newer linux kernels have framebuffer support. fbdev (not directfb, which old)
Specialize a type, not a var.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: VSync on other platforms than Windows
« Reply #2 on: July 14, 2017, 02:11:45 am »
For what i understood from that thread: https://unix.stackexchange.com/questions/182801/why-is-video-tearing-such-a-problem-in-linux , is that it's a OS problem, not software. In MacOS it seems to be opposite, that you need to install some 3rd party tool to disable VSync.

Other discussion there: https://stackoverflow.com/questions/589064/how-to-enable-vertical-sync-in-opengl
.. and i don't think this is related to framebuffers.

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: VSync on other platforms than Windows
« Reply #3 on: July 14, 2017, 08:28:10 am »
.. and i don't think this is related to framebuffers.
Ultimately it is... (almost) all higher level code eventually falls through to it (EGL, OpenGL, OpenVG, OpenGles, CGL, etc usually are built on top of it. Even X11). I refer to it because the fbdev is already vsynced in many cases (by necessity!) at the kernel driver level , but it depends on videocard hardware: even with fb tearing can occur.

I will add an example to the wiki. Also direct rendering.
« Last Edit: July 14, 2017, 08:40:17 am by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018