DirectX SDK

DirectDrawSurface7.Flip

The DirectDrawSurface7.Flip method makes the surface memory associated with the DDSCAPS_BACKBUFFER surface become associated with the front-buffer surface.

object.Flip( _ 
    ddS As DirectDrawSurface7, _ 
    flags As CONST_DDFLIPFLAGS)

Parameters

object
Object expression that resolves to a DirectDrawSurface7 object.
ddS
DirectDrawSurface7 object for an arbitrary surface in the flipping chain. The default for this parameter is Nothing, in which case DirectDraw cycles through the buffers in the order that they are attached to each other. If this parameter is not Nothing, DirectDraw flips to the specified surface, instead of the next surface in the flipping chain. The method fails if the specified surface is not a member of the flipping chain.
flags
One or more constants of the CONST_DDFLIPFLAGS enumeration specifying flip options.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to one of the following values:

DDERR_GENERIC
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_NOFLIPHW
DDERR_NOTFLIPPABLE
DDERR_SURFACEBUSY
DDERR_SURFACELOST
DDERR_UNSUPPORTED
DDERR_WASSTILLDRAWING

Remarks

This method can be called only for a surface that has the DDSCAPS_FLIP and DDSCAPS_FRONTBUFFER capabilities. The display memory previously associated with the front buffer is associated with the back buffer.

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 Nothing.

The DirectDrawSurface7.Flip method is always synchronized with the vertical blank. If the surface has been assigned to a video port, this method updates the visible overlay surface and the video port's target surface.

For more information, see Flipping Surfaces.

See Also

DirectDrawSurface7.GetFlipStatus