This method of the DirectDrawSurface Class makes the surface memory associated with the DDSCAPS_BACKBUFFER surface become associated with the front-buffer surface.
public void flip(DirectDrawSurface ddS, int flags);
ddS | The DirectDrawSurface object that will be flipped to. The default for this parameter is null; in which case, flip cycles through the buffers in the order they are attached to each other. This parameter is used only as an override. |
flags | Can be DDFLIP_WAIT. |
This method can be called only by a surface that has the DDSCAPS_FLIP and DDSCAPS_FRONTBUFFER values set. The display memory previously associated with the front buffer is associated with the back buffer. If there is more than one back buffer, a ring is formed and the surface memory buffers cycle one step through it every time flip is called.
The ddS parameter is used in rare cases when the back buffer is not the buffer that should become the front buffer. Typically this parameter is null.
The flip method will always be synchronized with the vertical blank.