Share via


IDirectDrawSurface::UpdateOverlay

A version of this page is also available for

Windows Embedded CE 6.0 R3

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 RECT structure 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 IDirectDrawSurface interface for the surface that is being overlaid.
  • lpDestRect
    Address of a RECT structure 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 DDOVERLAYFX structure.

    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 dckDestColorkey member of the DDOVERLAYFX structure as the color key for the destination surface.

    DDOVER_KEYSRC

    Uses the color key associated with the source surface.

    DDOVER_KEYSRCOVERRIDE

    Uses the dckSrcColorkey member of the DDOVERLAYFX structure 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_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 overlay is updated or an error occurs.

    DDOVER_WAITVSYNC

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

  • lpDDOverlayFx
    Address of a DDOVERLAYFX structure 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