IDirectDrawSurface7::AddAttachedSurface method (ddraw.h)

Attaches the specified z-buffer surface to this surface.

Syntax

HRESULT AddAttachedSurface(
  [in] LPDIRECTDRAWSURFACE7 unnamedParam1
);

Parameters

[in] unnamedParam1

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.

Requirements

Requirement Value
Target Platform Windows
Header ddraw.h
Library Ddraw.lib
DLL Ddraw.dll

See also

IDirectDrawSurface7