IDirectDrawSurface::AddAttachedSurface
HRESULT AddAttachedSurface(
LPDIRECTDRAWSURFACE lpDDSAttachedSurface);
Attaches a surface to another surface.
·Returns DD_OK if successful, or one of the following error values otherwise:
lpDDSAttachedSurface
Address of the DirectDrawSurface that is to be attached.
Possible attachments include z-buffers, alpha channels, and back buffers. Some attachments automatically break other attachments. For example, the 3DZBUFFER can only be attached to one back buffer at a time. Attachment is not bi-directional, and a surface cannot be attached to itself. Emulated surfaces (in system memory) cannot be attached to non-emulated surfaces. Unless one surface is a texture map, the two attached surfaces must be the same size. A flippable surface cannot be attached to another flippable surface of the same type; however, attaching two surfaces of different types is allowed. For example, a flippable z-buffer can be attached to a regular flippable surface. If a non-flippable surface is attached to another non-flippable surface of the same type, the two surfaces will become a flippable chain. If a non-flippable surface is attached to a flippable surface, it becomes part of the existing flippable chain. Additional surfaces can be added to this chain, and each call of the IDirectDrawSurface::Flip method will advance one step through the surfaces.