IDirectDrawSurface7::AddAttachedSurface method

Attaches the specified z-buffer surface to this surface.

Syntax


HRESULT AddAttachedSurface(
  [in]  LPDIRECTDRAWSURFACE7 lpDDSurface
);

Parameters

lpDDSurface [in]

Address of the IDirectDrawSurface7 interface for the surface to be attached.

Return value

If the method succeeds, the return value is DD_OK.

If it fails, the method can return one of the following error values:

  • DDERR_CANNOTATTACHSURFACE
  • DDERR_GENERIC
  • DDERR_INVALIDOBJECT
  • DDERR_INVALIDPARAMS
  • DDERR_SURFACEALREADYATTACHED
  • DDERR_SURFACELOST
  • DDERR_WASSTILLDRAWING

Remarks

AddAttachedSurface increments the reference count of the surface being attached. You can explicitly unattach the surface and decrement its reference count by using the IDirectDrawSurface7::DeleteAttachedSurface method. Unlike complex surfaces that you create with a single call to IDirectDraw7::CreateSurface, surfaces attached with this method are not automatically released. The application must release such surfaces.

You can attach only z-buffer surfaces with this method.

You must use LoadLibrary to explicitly link to Ddraw.dll and then use GetProcAddress to access the AddAttachedSurface method.

Requirements

Header

Ddraw.h

Library

Ddraw.dll

See also

IDirectDrawSurface7

 

 

Community Additions

ADD
Show:
© 2014 Microsoft