How to use wglSwapBuffers?

Hi
I want to use wglSwapBuffers in my examples-- I have seen this function in the book “More OpenGL Game Programming”.However I have not found this function in wglext.h( or wglew.h ).I have seen a similar function called wglSwapBuffersMscOML() however. How to disable VSYNC with these functions?
-Ehsan-

1.) There is a Win32 API function wglSwapLayerBuffers().
The SwapBuffers() function you might know is just a wrapper on top of this. SwapBuffers() swaps all color buffers from back to front.
With wglSwapLayerBuffers() you can swap mainplane and overlay plane independently. That is, if your OpenGL implementation supports overlays and you use them.
If not, SwapBuffers() is the same as wglSwapLayerBuffers(hdc, WGL_SWAP_MAIN_PLANE).

2.) Waiting for vertical retrace is not controlled with these functions but with the extension http://www.opengl.org/registry/specs/EXT/wgl_swap_control.txt

If your OpenGL implementaton supports this and returns a valid function pointer for it, call wglSwapIntervalEXT(0) and both of the above mentioned swap buffer calls should stop waiting on the next vsync.

In most graphics drivers there is a setting in their control panels which can be used to ovveride this.

There is wglSwapBuffers and wglSwapLayerBuffers and wglSwapMultipleBuffers which is standard on all Windows. It’s not recommended to use these because it causes some weird behavior/performance loss.

Only use SwapBuffers(HDC hdc)
wglSwapBuffers is suppose to do the same thing, but it’s not recommended.
Some of those wgl functions are defined in wingdi.h

Thanks
With wglSwapLayerBuffers() and wglSwapIntervalEXT(0) I disabled VSYNC–It’s an option in our game.
-Ehsan-

You only need wglSwapIntervalEXT to control v-sync
wglSwapIntervalEXT(0) = off
wglSwapIntervalEXT(1) = on

You only need wglSwapIntervalEXT to control v-sync
wglSwapIntervalEXT(0) = off
wglSwapIntervalEXT(1) = on

There’s also wgoSwapIntervalEXT(-1) which is available on some drivers (detected via the WGL_SWAP_CONTROL_TEAR extension) which disables vertical sync when the framerate drops below the maximum that the monitor supports and reenables it automatically when the FPS hits the maximum again. This is also a feature worth implementing.

A post was split to a new topic: Re: How to use wglSwapBuffers?