DirectX SDK |
The DirectDrawSurface7.AddAttachedSurface method attaches the specified surface to this surface.
object.AddAttachedSurface(ddS As DirectDrawSurface7)
If the method fails, it raises an error, and Err.Number can be set to one of the following values:
DDERR_CANNOTATTACHSURFACE |
DDERR_GENERIC |
DDERR_INVALIDOBJECT |
DDERR_INVALIDPARAMS |
DDERR_SURFACEALREADYATTACHED |
DDERR_SURFACELOST |
DDERR_WASSTILLDRAWING |
You can explicitly unattach the surface by using the DirectDrawSurface7.DeleteAttachedSurface method. Unlike complex surfaces that you create with a single call to DirectDraw7.CreateSurface, surfaces attached with this method are not automatically released. It is the application's responsibility to release such surfaces.
Possible attachments include z-buffers, alpha channels, and back buffers. Some attachments automatically break other attachments. For example, the 3-D z-buffer can be attached to only one back buffer at a time. Attachment is not bidirectional, and a surface cannot be attached to itself. Emulated surfaces (in system memory) cannot be attached to nonemulated surfaces. Unless one surface is a texture map, the two attached surfaces must be the same size. A flipping surface cannot be attached to another flipping surface of the same type; however, attaching two surfaces of different types is allowed. For example, a flipping z-buffer can be attached to a regular flipping surface. If a nonflipping surface is attached to another nonflipping surface of the same type, the two surfaces become a flipping chain. If a nonflipping surface is attached to a flipping surface, it becomes part of the existing flipping chain. Additional surfaces can be added to this chain, and each call to the DirectDrawSurface7.Flip method advances one step through the surfaces.
DirectDrawSurface7.DeleteAttachedSurface, DirectDrawSurface7.GetAttachedSurfaceEnum