Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method repositions or modifies the visual attributes of an overlay surface. These surfaces must have the DDSCAPS_OVERLAY flag set.

Syntax

HRESULT UpdateOverlay(
  LPRECT
 lpSrcRect, 
  LPDIRECTDRAWSURFACE
 lpDDDestSurface, 
  LPRECT
 lpDestRect, 
  DWORD
 dwFlags, 
  LPDDOVERLAYFX
 lpDDOverlayFx
); 

Parameters

lpSrcRect

Address of a RECTstructure that defines the x, y, width, and height of the region on the source surface being used as the overlay.

This parameter can be NULL when hiding an overlay, or to indicate that the entire overlay surface is to be used and that the overlay surface conforms to any boundary and size alignment restrictions imposed by the device driver.

lpDDDestSurface

Address of the IDirectDrawSurfaceinterface for the surface that is being overlaid.

lpDestRect

Address of a RECTstructure that defines the x, y, width, and height of the region on the destination surface that the overlay should be moved to. This parameter can be NULL when hiding the overlay.

dwFlags

The following table shows the possible flags.

Flag Description

DDOVER_ALPHACONSTOVERRIDE

Indicates that the overlay should be alpha-blended with the destination using the dwAlphaConst member of the DDOVERLAYFXstructure.

DDOVER_ALPHADEST

Uses either the alpha information in pixel format or the alpha channel surface attached to the destination surface as the alpha channel for this overlay.

DDOVER_ALPHADESTNEG

Indicates that the destination surface becomes more transparent as the alpha value increases (zero equals opaque).

DDOVER_ALPHASRC

Uses either the alpha information in pixel format or the alpha channel surface attached to the source surface as the source alpha channel for this overlay.

DDOVER_ALPHASRCNEG

Indicates that the source surface becomes more transparent as the alpha value increases (zero is opaque).

DDOVER_HIDE

Turns off this overlay.

DDOVER_KEYDEST

Uses the color key associated with the destination surface.

DDOVER_KEYDESTOVERRIDE

Uses the dckDestColorkeymember of the DDOVERLAYFXstructure as the color key for the destination surface.

DDOVER_KEYSRC

Uses the color key associated with the source surface.

DDOVER_KEYSRCOVERRIDE

Uses the dckSrcColorkeymember of the DDOVERLAYFXstructure as the color key for the source surface.

DDOVER_MIRRORLEFTRIGHT

Renders the overlay as mirrored so that the left side of the surface is drawn on the right and the right side is drawn on the left.

DDOVER_MIRRORUPDOWN

Renders the overlay as mirrored so that the top of the surface is drawn at the bottom and the bottom is drawn at the top.

DDOVER_SHOW

Turns on this overlay.

DDOVER_WAITNOTBUSY

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

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

DDOVER_WAITVSYNC

Waits for a V-Sync before performing the overlay update.

lpDDOverlayFx

Address of a DDOVERLAYFXstructure that describes the effects to be used. This parameter can be NULL if the DDOVER_DDFX flag is not specified.

Return Value

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_DEVICEDOESNTOWNSURFACE

DDERR_GENERIC

DDERR_HEIGHTALIGN

DDERR_INVALIDOBJECT

DDERR_INVALIDPARAMS

DDERR_INVALIDRECT

DDERR_NOSTRETCHHW

DDERR_NOTAOVERLAYSURFACE

DDERR_OUTOFCAPS

DDERR_SURFACELOST

DDERR_UNSUPPORTED

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

Requirements

Header ddraw.h
Library ddraw.lib
Windows Embedded CE Windows Embedded CE 6.0 and later
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later