Vertical sync -- which one?

Hello, I am currenly working on several projects in opengl, and Vsync is crucial to one of them in particular. Which function from which library would you recommend, and where can I find documentation on these commands? Thanks

Nate O.

You forgot to tell what OS you are interested in, which is important
as double buffering features are system and hardware dependant.
When you use double buffering and call something like swapBuffers()
(when using OS-portable library ‘glut’ it will be glutSwapBuffers()) the
video subsystem should swap buffers during the time of vertical return.
However, on MS Windows this in most cases will work only in full screen mode.
In windowed mode, swaping buffers will copy the video memory contents
wich will probable take longer than the time of vertical return and tearing will
be visible.
The perfect solution for MS Windows would be to use Direct Draw, but
unfortunately OpenGL video drivers don’t have to support the rendering
on a Direct Draw surface (it sometimes works, sometimes not).
However, if the only thing you are interested in is knowing the time when
vertical return starts, you may use one of Direct Draw library API function (I dont
remember its name).