Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IDirectDrawSurface::Flip

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

This method makes the surface memory associated with the DDSCAPS_BACKBUFFER surface become associated with the front-buffer surface.


HRESULT Flip(
  LPDIRECTDRAWSURFACE lpDDSurfaceTargetOverride, 
  DWORD dwFlags
);

lpDDSurfaceTargetOverride

Address of the IDirectDrawSurface interface for an arbitrary surface in the flipping chain.

The default for this parameter is NULL, in which case DirectDraw cycles through the buffers in the order they are attached to each other.

If this parameter is not NULL, 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.

dwFlags

Flags specifying flip options. The following table shows the possible flags.

Flag Description

DDFLIP_EVEN

For use only when displaying video in an overlay surface. The new surface contains data from the even field of a video signal. This flag cannot be used with the DDFLIP_ODD flag.

DDFLIP_INTERVAL1 DDFLIP_INTERVAL2 DDFLIP_INTERVAL4

These flags indicate how many vertical retraces to wait between each flip.

The default is 1.

DirectDraw returns DERR_WASSTILLDRAWING for each surface involved in the flip until the specified number of vertical retraces has occurred.

If DDFLIP_INTERVAL2 is set, DirectDraw will flip on every second vertical sync. If DDFLIP_INTERVAL4 is set, DirectDraw will flip on every fourth sync.

These flags are effective only if DDCAPS2_FLIPINTERVAL is set in the DDCAPS structure returned for the device.

DDFLIP_ODD

For use only when displaying video in an overlay surface. The new surface contains data from the odd field of a video signal. This flag cannot be used with the DDFLIP_EVEN flag.

DDFLIP_WAITNOTBUSY

Waits for a previously initiated drawing operation to complete instead of returning immediately with the DDERR_WASSTILLDRAWING return value.

If a previous drawing operation is in progress at the time of the call, this flag defers returning from the call until the new flip operation begins or an error occurs.

DDFLIP_WAITVSYNC

Waits for a V-Sync before performing the flip operation.

If the method succeeds, the return value is DD_OK.

If the method fails, the return value may be one of the following error values:

DDERR_GENERIC

DDERR_INVALIDOBJECT

DDERR_INVALIDPARAMS

DDERR_NOFLIPHW

DDERR_NOTFLIPPABLE

DDERR_SURFACEBUSY

DDERR_SURFACELOST

DDERR_UNSUPPORTED

DDERR_WASSTILLDRAWING

For more information on these error codes see DirectDraw Return Values.

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

IDirectDrawSurface::Flip will not be synchronized with the vertical blank by default. Use DDFLIP_WAITVSYNC to override this behavior.

Headerddraw.h
Libraryddraw.lib
Windows Embedded CEWindows Embedded CE 6.0 and later
Windows MobilePocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later

Community Additions

Show:
© 2014 Microsoft